/*匹配特殊字符*/ function stripscript(s) { var pattern = new RegExp("[-`[email protected]#$^&*()=|{}‘:;‘,\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“‘。,、?]"); var rs = ‘‘; for (var i = 0; i < s.length; i++) { rs = rs + s.substr(i, 1).replace(pattern,‘‘); } return rs; }
时间: 2024-10-09 16:01:58