验证手机号码代码简单代码实例:
本章节分享一段代码实例,它实现了对手机号码的简单验证效果。
代码实例如下:
function done(input) {
var regex = /^((/+)?86|((/+)?86)?)0?1[3458]/d{9}$/;
if (input.match(regex)) {
return true;
}
else {
return false;
}
}
var num = "15966874093";
console.log(done(num));
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/8755.html