Created
August 23, 2016 05:41
-
-
Save alexsasharegan/3525cfaec316ccfad537e9d16a46efb9 to your computer and use it in GitHub Desktop.
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
let emailRegEx = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; | |
if (emailRegEx.test(email)) { | |
$email.removeClass('invalid').addClass('valid'); | |
} else { | |
$email.removeClass('valid').addClass('invalid'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment