//验证中文字符 function CheckChinese(str) { //var reg = new RegExp("[\\u4E00-\\u9FFF]+","g"); var reg = /^[\u4E00-\u9FA5\uF900-\uFA2D\u0020]*$/; return reg.test(str); }其实下面这段才是中文字符匹配
var reg = /^[\u4E00-\u9FA5\uF900-\uFA2D]*$/;
这里仅仅加上了\u0020,因为\u0020代表空格。原文链接:https://www.f2er.com/regex/359853.html