Created
July 1, 2014 14:08
-
-
Save allanbatista/97b0850406c8b04c5c6d to your computer and use it in GitHub Desktop.
Regex Validate Email
This file contains hidden or 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 validateEmail(email){ | |
reg = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/ | |
return reg.test(email); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment