Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- i'm trying to make a log parser for final fantasy 14, using regexs to pull out interesting information from each line of the game's logs.
- language: python
- Sample lines:
- Critical! Your Light Slash hits the carrion chiglet from the left for 93 points of damage.
- Your Howling Vortex hits the carrier ladybug for 170 points of damage.
- Desired result:
- from line 1: Critical!, Light Slash, carrion chiglet, left, 93
- from line 2: , Howling Vortex, carrier ladybug, , 170
- my attempt/results:
- python regex: (?P<critical>Critical!\s|.*)Your\s(?P<attack>.*)\shits\s(the)?\s(?P<monster>.*)(\sfrom\sthe)?(?P<direction>.*)\sfor\s(?P<damage>\d*)\spoints
- non python regex:(Critical!\s|.*)Your\s(.*)\shits\s(?:the)?\s(.*)(?:\sfrom\sthe)?(.*)\sfor\s(\d*)\spoints
- line 1: Critical!, Light Slash, carrion chiglet from the left, , 93
- line 2: , Howling Vortex, carrier ladybug, , 170
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement