Skip to content

Instantly share code, notes, and snippets.

@amontalenti
Created January 8, 2015 14:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amontalenti/f917987b16fbe5074b65 to your computer and use it in GitHub Desktop.
Save amontalenti/f917987b16fbe5074b65 to your computer and use it in GitHub Desktop.
>>> import re
>>> eml = re.compile(r"([^@|\s]+@[^@]+\.[^@|\s]+)")
>>> match = eml.search("some text that has a test@test.com email address")
>>> match.group(1)
"test@test.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment