Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Underscore helper - checkif a string is a valid email
// isEmail underscore helper
// source: https://gist.github.com/tracend/7763827
_.mixin({
isEmail: function( email ){
var format = /^[a-zA-Z0-9\-_]+(\.[a-zA-Z0-9\-_]+)*@[a-z0-9]+(\-[a-z0-9]+)*(\.[a-z0-9]+(\-[a-z0-9]+)*)*\.[a-z]{2,4}$/;
return (email.match(format));
}
});
@qinbx

This comment has been minimized.

Copy link

@qinbx qinbx commented Nov 13, 2015

Hi,
Seems above not works for new .marketing domain email address.
Eg: test@test.marketing

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