checkPhone() {
//手机号正则
var phone = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
//使用
if(!phone.test(mobile)) {
console.log('手机号格式不正确');
return true;
}
//密码正则
var password =/^(?=.*\d)(?=.*[a-zA-Z])(?=.*[\W_]).{8,}$/
//使用
if(!password .test(pass)) {
console.log('手机号格式不正确');
return true;
}
正则表达式
最新推荐文章于 2022-12-03 18:19:48 发布