Skip to content

Instantly share code, notes, and snippets.

@ephbaum
Last active August 29, 2015 14:16
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 ephbaum/298d53914d546b890449 to your computer and use it in GitHub Desktop.
Save ephbaum/298d53914d546b890449 to your computer and use it in GitHub Desktop.
typicalValidEmailFormatRegExp
var typicalValidEmailFormatRegExp = /(^[\S]+@[\S]+\.[\S]{2,63}$)/; // @fskirschbaum || My RegExp could beat up your RegExp. Fight Me. || Says, essentialy, a bunch of characters, an @ symbol, a bunch more characters, a single dot, ends with a group of characters between 2 and 63 (the allowed min/max size of valid .tld ). Allows a hefty chunk of expected valid email addresses, disallows most typical user error type input of invalid email address. boom.
if ( ___VAR___.match( typicalValidEmailFormatRegExp ) === null ) { return false; }
// see example here: @link https://regex101.com/r/vD9zK7/4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment