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