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; } console.log(stripscript("出售~~!@#¥%……&*()——+/*-+ ,。、"));
时间: 2024-10-14 03:50:20