Skip to content

Instantly share code, notes, and snippets.

@silianlinyi
Created June 29, 2014 07:52
Show Gist options
  • Save silianlinyi/79664671b8966ac3534b to your computer and use it in GitHub Desktop.
Save silianlinyi/79664671b8966ac3534b to your computer and use it in GitHub Desktop.
判断是否是手机号码
function isPhone(val) {
if (!/^(((13[0-9]{1})|159|180|181|186|189|(15[0-9]{1}))+\d{8})$/.test(val)) {
return false;
} else {
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment