Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Underscore helper - checkif a string is a valid email
// isEmail underscore helper
// source:
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));

This comment has been minimized.

Copy link

@qinbx qinbx commented Nov 13, 2015

Seems above not works for new .marketing domain email address.

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