Created
July 29, 2015 09:18
-
-
Save makmac213/875a18593931855e4e06 to your computer and use it in GitHub Desktop.
Check if string is an 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
function isEmail(email){ | |
// http://www.w3.org/TR/html-markup/input.email.html | |
var emailReg = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/ | |
return emailReg.test(email); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment