在javascript 中,如何正确的使用,正则表达式, 过滤特殊字符(非字母表中的字符[a-zA-Z0-9])

时间:2016-09-30 21:10:09   收藏:0   阅读:371

1

1

1

在javascript 中,如何正确的使用,正则表达式, 过滤特殊字符(非字母表中的字符[a-zA-Z0-9])

 

JavaScript 正则表达式:

 

 

var reg = /([\(\)\[\]\{\}\^\$\+\,\s\_\:\-\*\?\.\"\‘\|\/\\])/g;
str = "0_0 (: /-\ :) 0-0";

var s = str.replace(reg,"");
//0000

var l = s.toLowerCase();

document.write(l)) ;


//You‘ll need to remove all non-alphanumeric characters

  

 

 

1

1

1

1

1

1

1

1

原文:http://www.cnblogs.com/anonymous-ufo/p/5924776.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!