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);
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/18780.html