Created
June 17, 2015 12:34
-
-
Save csharpforevermore/db1308289ea103c4cfb8 to your computer and use it in GitHub Desktop.
Validates emails. Taken from StackOverflow http://stackoverflow.com/questions/46155/validate-email-address-in-javascript
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) { | |
var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; | |
return re.test(email); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment