Advertisement
DiYane

Extract emails

Sep 27th, 2023
1,062
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. import re
  2.  
  3. some_string = input()
  4. pattern = r'((?<=\s)([a-z0-9]+[-\.\_a-z0-9]*)@[a-z\-]+(\.[a-z]+)+)\b'
  5. matches = re.findall(pattern, some_string)
  6.  
  7. for match in matches:
  8.     print(match[0])
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement