Skip to content

Instantly share code, notes, and snippets.

@logicplace
Created May 2, 2011 05:54
Show Gist options
  • Save logicplace/951220 to your computer and use it in GitHub Desktop.
Save logicplace/951220 to your computer and use it in GitHub Desktop.
email validation regex. Complete to spec. Requires a lookarounds (trying to remove the lookbehind for JS compatibility)
^(?!\.)(([a-zA-Z0-9!#$%&'*+/=?^_`{}|~\-]|\.(?!\.))+|"[^"\n\r]+")(?<!\.)([+\-][a-zA-Z0-9!#$%&'*+/=?^_`{}|~\-.]+)?@(\[(?:[0-9]{1,3}\.){3}[0-9]{1,3}\]|[a-zA-Z][a-zA-Z\-$_@.&+!*"'(),]*)$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment