Skip to content

Instantly share code, notes, and snippets.

@beznosd
Last active April 13, 2017 17:28
Show Gist options
  • Save beznosd/43edd665efd3e8679b57770e61d8c4d5 to your computer and use it in GitHub Desktop.
Save beznosd/43edd665efd3e8679b57770e61d8c4d5 to your computer and use it in GitHub Desktop.
function isValidEmail(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);
}
document.write(isValidEmail('vasya@mail.com'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment