Skip to content

Instantly share code, notes, and snippets.

@CastenettoA
Last active September 25, 2017 00:59
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 CastenettoA/5948754 to your computer and use it in GitHub Desktop.
Save CastenettoA/5948754 to your computer and use it in GitHub Desktop.
A simple script to check the email by Javascript
function isEmail(email) {
var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
return regex.test(email);
}
/*
* usage:
* var check = isEmail(example@email.com);
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment