Advertisement
go6odn28

extract_email_finditter

Mar 15th, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. import re
  2.  
  3. text = input()
  4. pattern = r"(^|(?<=\s))([a-z0-9]+[\.\-\_a-z]*)@([a-z\-]+)(\.[a-z]+)+\b"
  5. emails = re.finditer(pattern, text)
  6. for email in emails:
  7.     current_email = email.group()
  8.     print(current_email)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement