Skip to content

Instantly share code, notes, and snippets.

@bultas
Created April 29, 2015 09:34
Show Gist options
  • Save bultas/20437398a6342ffb766c to your computer and use it in GitHub Desktop.
Save bultas/20437398a6342ffb766c to your computer and use it in GitHub Desktop.
Email validation regex
// http://stackoverflow.com/a/46181
// live demo http://output.jsbin.com/ozeyag/19
function validateEmail(email) {
var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
return re.test(email);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment