Created
April 29, 2015 09:34
-
-
Save bultas/20437398a6342ffb766c to your computer and use it in GitHub Desktop.
Email validation regex
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
// http://stackoverflow.com/a/46181 | |
// live demo http://output.jsbin.com/ozeyag/19 | |
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