Last active
January 23, 2017 20:49
-
-
Save tracend/7763827 to your computer and use it in GitHub Desktop.
Underscore helper - checkif a string is a valid email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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)); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Seems above not works for new .marketing domain email address.
Eg: test@test.marketing