Skip to content

Instantly share code, notes, and snippets.

@oikewll
Created April 1, 2017 09:06
Show Gist options
  • Save oikewll/d951b3619b3763995c7f6d077c2f78f5 to your computer and use it in GitHub Desktop.
Save oikewll/d951b3619b3763995c7f6d077c2f78f5 to your computer and use it in GitHub Desktop.
原生JavaScript判断字符是否为A-Za-z英文字母
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