Skip to content

Instantly share code, notes, and snippets.

@ronanq
Last active December 17, 2015 13:29
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 ronanq/5617504 to your computer and use it in GitHub Desktop.
Save ronanq/5617504 to your computer and use it in GitHub Desktop.
Xero API email validation REGEX
^\s*((?>[a-zA-Z\d!#$%&'*+\-/=?^_{|}~]+\x20*|""((?=[\x01-\x7f])[^""\\]|\\[\x01-\x7f])*""\x20*)*(?<angle><))?((?!\.)(?>\.?[a-zA-Z\d!#$%&'*+\-/=?^_{|}~]+)+|""((?=[\x01-\x7f])[^""\\]|\\[\x01-\x7f])*"")@(((?!-)[a-zA-Z\d\-]+(?<!-)\.)+[a-zA-Z]{2,}|\[(((?(?<!\[)\.)(25[0-5]|2[0-4]\d|[01]?\d?\d)){4}|[a-zA-Z\d\-]*[a-zA-Z\d]:((?=[\x01-\x7f])[^\\\[\]]|\\[\x01-\x7f])+)\])(?(angle)>)\s*$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment