Skip to content

Instantly share code, notes, and snippets.

@haohcraft
Last active August 29, 2015 14:03
Show Gist options
  • Save haohcraft/5fb2d8cf6528e9e3cd0c to your computer and use it in GitHub Desktop.
Save haohcraft/5fb2d8cf6528e9e3cd0c to your computer and use it in GitHub Desktop.
Check if the email is valid
function validateEmail(email) {
var re = /^(([^<>()[\]\\.,;:\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,}))$/;
return re.test(email);
}
@haohcraft
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment