Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- text=input()
- regex=r"(\@+|\#+)(?P<eggs>[a-z]{3,})(\@+|\#+)[^A-Za-z0-9]*/+(?P<digits>[0-9]+)+/+"
- match=re.finditer(regex,text)
- for i in match:
- if i.group("eggs")!="" and i.group("digits"):
- print(f"You found {i.group('digits')} {i.group('eggs')} eggs!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement