Created
April 1, 2017 09:06
-
-
Save oikewll/d951b3619b3763995c7f6d077c2f78f5 to your computer and use it in GitHub Desktop.
原生JavaScript判断字符是否为A-Za-z英文字母
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
function isLetters( str ){ | |
var re=/^[A-Za-z]+$/; | |
if (str.match(re) == null) | |
return false; | |
else | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment