Advertisement
viligen

extract_emails

Nov 20th, 2021
744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. import re
  2.  
  3. line = input()
  4. pattern = r"(^|\s)([a-z0-9]+[\.\-\_]*[a-z0-9]*@[a-z\-?]+(\.[a-z]+)+\b)"
  5. matches = re.findall(pattern, line)
  6. for match in matches:
  7.     print(match[1])
  8.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement