首页 > 编程语言 > 详细

javascript 过滤中文汉字和 过滤中文汉字和符号的方法

时间:2020-04-07 21:29:15      阅读:77      评论:0      收藏:0      [点我收藏+]

javascript 过滤中文汉字和 过滤中文汉字和中文符号的方法

 

过滤中文汉字

 

   
var hebingdatastr="无法为“

var reg = /[\u4e00-\u9fa5]/g; hebingdatastr = hebingdatastr.replace(reg, "");

 

 

过滤汉字和中文符号

 

var hebingdatastr="ef啦啦,。。d28";
var reg = /[^\x00-\xff]/g;
hebingdatastr = hebingdatastr.replace(reg, "");
alert(hebingdatastr);

 

javascript 过滤中文汉字和 过滤中文汉字和符号的方法

原文:https://www.cnblogs.com/newmiracle/p/12656031.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!