Skip to content

Instantly share code, notes, and snippets.

@msenkpiel
Created October 17, 2011 13:14
Show Gist options
  • Save msenkpiel/1292582 to your computer and use it in GitHub Desktop.
Save msenkpiel/1292582 to your computer and use it in GitHub Desktop.
Javascript E-Mail Validation
var error = false;
var pattern = /^([a-zA-Z0-9+_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
var mailAddress = 'mail@example.com';
if(!pattern.test(mailAddress))
{
error = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment