Skip to content

Instantly share code, notes, and snippets.

@JosiasAurel
Created January 2, 2020 12:35
Show Gist options
  • Save JosiasAurel/a5466bea719eb8b31d03e93f4d897150 to your computer and use it in GitHub Desktop.
Save JosiasAurel/a5466bea719eb8b31d03e93f4d897150 to your computer and use it in GitHub Desktop.
import re
pattern = r"([\w\.-]+)@([\w\.-]+)(\.[\w\.]+)"
str = input("Enter the text from which to extract : ")
match = re.search(pattern, str)
if match:
print(match.group())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment