Skip to content

Instantly share code, notes, and snippets.

@james-see
Last active April 20, 2022 22:21
Show Gist options
  • Save james-see/cc9ededd115d881de1b650616b362ae4 to your computer and use it in GitHub Desktop.
Save james-see/cc9ededd115d881de1b650616b362ae4 to your computer and use it in GitHub Desktop.
The best email parser on the planet. Email extraction. You are welcome world.
import re
def finder(stringer):
EMAIL_REGEX = re.compile("(?:[a-zA-Z0-9!#$%&'*+\-\/\=?^_`{|}~]|\.(?!\.)){1,64}@(?:(?:[a-zA-Z0-9\-]){1,63}\.(?!\.)){1,4}(?:[a-zA-Z0-9]{2,12})")
emails = EMAIL_REGEX.findall(stringer)
return emails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment