Skip to content

Instantly share code, notes, and snippets.

@dpmango
Created January 24, 2017 21:42
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 dpmango/8622918371c51709f27f0c5c6553e299 to your computer and use it in GitHub Desktop.
Save dpmango/8622918371c51709f27f0c5c6553e299 to your computer and use it in GitHub Desktop.
// validation
var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
var emailIsValid = false;
if(emailRegex.test(myEmail.val())){
emailIsValid = true;
} else {
emailIsValid = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment