wordpress大型网站,个人网页设计手绘,中小企业加盟网站建设,冠县网站建设多少钱// 统计字符串中汉字数量function countChinese(str) {if (!str) {return 0;}var reg /[\u4e00-\u9fa5]/g; // 匹配中文字符的正则表达式var count str.match(reg); // 匹配字符串中所有的中文字符return count ? count.length : 0; // 返回中文字符的数量#xff0c;如果未… // 统计字符串中汉字数量function countChinese(str) {if (!str) {return 0;}var reg /[\u4e00-\u9fa5]/g; // 匹配中文字符的正则表达式var count str.match(reg); // 匹配字符串中所有的中文字符return count ? count.length : 0; // 返回中文字符的数量如果未匹配到中文字符则返回 0}// 统计字符串中中文字符数量function countChineseSymbols(str) {if (!str) {return 0;}var reg /[。、【】《》——]/g; // 匹配中文符号的正则表达式var count str.match(reg); // 匹配字符串中所有的中文符号return count ? count.length : 0; // 返回中文符号的数量如果未匹配到中文符号则返回 0}// 统计字符串中数字数量function countNumbers(str) {if (!str) {return 0;}var reg /\d/g; // 匹配数字的正则表达式var count str.match(reg); // 匹配字符串中所有的数字return count ? count.length : 0; // 返回数字的数量如果未匹配到数字则返回 0}// js统计字符串大写字母的数量function countUpperCase(str) {if (!str) {return 0;}var reg /[A-Z]/g; // 匹配大写字母的正则表达式var count str.match(reg); // 匹配字符串中所有的大写字母return count ? count.length : 0; // 返回大写字母的数量如果未匹配到大写字母则返回 0}// js统计字符串小写字母的数量function countLowerCase(str) {if (!str) {return 0;}var reg /[a-z]/g; // 匹配小写字母的正则表达式var count str.match(reg); // 匹配字符串中所有的小写字母return count ? count.length : 0; // 返回小写字母的数量如果未匹配到小写字母则返回 0}