Forked from dreamstarter/Javascript - Simple email validation
Created
November 28, 2016 21:50
-
-
Save ncou/a661bac7c7856581aeca16e8cb9a3f1f to your computer and use it in GitHub Desktop.
Javascript - Use a regex to check the email address input.
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 checkEmail(email) { | |
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; | |
if (!reg.test(email)) return false; | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment