Advertisement
bl00dt3ars

Untitled

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