/[u4e00-u9fa5]/汉字的正则匹配 var value = str.replace(/[u4e00-u9fa5]/g," "); //将汉字替换为两个空格 return value.length;