Skip to content

Instantly share code, notes, and snippets.

@bgantick
Last active December 9, 2016 20:44
Show Gist options
  • Save bgantick/a381f29db02bb6dd3f3a460867e14b03 to your computer and use it in GitHub Desktop.
Save bgantick/a381f29db02bb6dd3f3a460867e14b03 to your computer and use it in GitHub Desktop.
js email validation
function validateEmail(uEmail) {
var filter = /^(([\w-\.]|([-]|[_]|[.]|[+]))+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (filter.test(uEmail)) {
return true;
} else {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment