Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- hitre = re.compile(r"(?P<critical>Critical!\s|.*)Your\s(?P<attack>.*)\shits\s(the)?\s(?P<monster>.*?)(\sfrom\sthe)?(?P<direction>.*?)\sfor\s(?P<damage>\d*)\spoints")
- with open("cleanlog.txt","r") as log:
- for line in log:
- print(line)
- m = hitre.match(line)
- if (m!=None):
- print("critical"+m.group('critical'))
- print("attack"+m.group('attack'))
- print("monster"+m.group('monster'))
- print("direction"+m.group('direction'))
- print("damage"+m.group('damage'))
- Your Circle Slash hits the wood weevil from the left for 213 points of damage.
- critical:
- attack: Circle Slash
- monster:
- direction: wood weevil from the left
- damage: 213
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement