js 正则判断全部是中文

let re = /[^\u4e00-\u9fa5]/;
if (re.test(this.data.studentName)) {
       wx.showToast({
             title: '孩子姓名必须是汉字',
              icon: 'none'
         })
         return
}
posted @ 2021-11-24 17:01  郭大蛋子  阅读(414)  评论(0编辑  收藏  举报