1 var regName = /^[u4e00-u9fa5]{2,4}$/; 2 if (!regName.test(examinee.name)) { 3 wx.showToast({ 4 title: "请正确输入您的姓名", 5 icon: 'none', 6 mask: true, //是否显示透明蒙层,防止触摸穿透,默认:false 7 duration: 2000 8 }); 9 return false; 10 }