Advertisement
pacho_the_python

Untitled

Mar 19th, 2022
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. import re
  2.  
  3. text_data = input()
  4.  
  5. user_pattern = r"( |^)[a-zA-Z0-9]+([/.|\-|/_][a-zA-Z0-9]+)?"
  6. host_pattern = r"([a-zA-Z0-9]+[\.|\-|\_])+[a-zA-Z0-9]+"
  7. email = rf"{user_pattern}@{host_pattern}"
  8. result = re.finditer(email, text_data)
  9.  
  10. for i in result:
  11.     print(i.group())
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement