Skip to content

Instantly share code, notes, and snippets.

@kara-ryli
Created March 25, 2010 17:17
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kara-ryli/343843 to your computer and use it in GitHub Desktop.
Save kara-ryli/343843 to your computer and use it in GitHub Desktop.
The HTML5 e-mail address syntax.
/^(?:[a-z\d!#\$%&'\*\+\-\/=\?\^_`\{\|\}~]+|\.)+@[a-z\d\-]+(?:\.[a-z\d\-]+)*$/i
@kara-ryli
Copy link
Author

This regular expression describes the HTML5 e-mail address syntax. The syntax is described in the spec as ABNF format

1*( atext / "." ) "@" ldh-str 1*( "." ldh-str )

But to figure out what the hell that means, you must read the ABNF format RFC, the e-mail RFC and a domain name RFC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment