//验证姓名,包含xxx·xxx(西亚利·买买提高原狼)
if(!(/^[\u4e00-\u9fa5]{2,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(params.userName))){
wx.showToast({
title: '请输入正确的姓名!',
icon: 'none',
});
return
}
//验证手机号
if(!(/^1[3456789]\d{9}$/.test(params.phone))){
wx.showToast({
title: '请输入正确的手机号码!',
icon: 'none',
});
return
}
积累正则表达式
最新推荐文章于 2024-04-30 18:28:48 发布