Last active
September 23, 2015 02:20
-
-
Save jtribble/04569cf0e7a48a22bd9a to your computer and use it in GitHub Desktop.
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
| /** | |
| * Is string a valid email address? | |
| * | |
| * @param {string} str | |
| * @return {boolean} | |
| */ | |
| var validEmail = function (str) { | |
| var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; | |
| return re.test(str); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment