手机号码验证
程序员文章站
2021-12-17 21:59:00
...
function isMibile(s) {
var flg=false;
var field13=/^13\d{9}$/g;
var field15=/^15[0,1,3,5,6,7,8,9]\d{8}$/g;
var field18=/^18[6,8,9]\d{8}$/g;
if((field13.exec(s)) || (field15.exec(s)) || (field18.exec(s))) {
flg=true;
} else {
flg=false;
}
return flg;
}