Skip to content

Instantly share code, notes, and snippets.

@ferdiemmen
Created December 19, 2017 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ferdiemmen/bb61e424b5f78166d1a463f7b7c3683b to your computer and use it in GitHub Desktop.
Save ferdiemmen/bb61e424b5f78166d1a463f7b7c3683b to your computer and use it in GitHub Desktop.
Regex which covers all possible e-mail addresses according to the RFC spec
Javascript:
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
Python:
r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment