<div class="codetitle"> <span><a style="CURSOR: pointer" data="26845" class="copybut" id="copybut26845" onclick="doCopy('code26845')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code26845"> <br>function stripscript(s) <br>{ <br>var pattern = new RegExp("[%--`~!@#$^&*()=|{}':;',\\[\\]./?~!@#¥……&*()——|{}【】‘;:”“'。,、?]") //格式 RegExp("[在中间定义特殊过滤字符]")<br>var rs = ""; <br>for (var i = 0; i rs = rs+s.substr(i, 1).replace(pattern, ''); <br>}<br>return rs;<br>}<br> </div>