Skip to content

Instantly share code, notes, and snippets.

@weivall
Created August 9, 2012 15:51
Show Gist options
  • Save weivall/3305329 to your computer and use it in GitHub Desktop.
Save weivall/3305329 to your computer and use it in GitHub Desktop.
isValidEmail
function isValidEmail(email){
return /^((([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+(\.([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+)*)@((((([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.))*([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.)[\w]{2,4}|(((([0-9]){1,3}\.){3}([0-9]){1,3}))|(\[((([0-9]){1,3}\.){3}([0-9]){1,3})\])))$/.test(email);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment