标签:
function stripscript(s) { var pattern = new RegExp("[`~!@#$^&*()%+-=|{}‘:;‘,\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“‘。,、?]") var rs = ""; for (var i = 0; i < s.length; i++) { rs = rs + s.substr(i, 1).replace(pattern, ‘‘); } return rs; } console.log(stripscript("出售~~!@#¥%……&*()——+/*-+ ,。、"));
标签:
原文地址:http://www.cnblogs.com/sunons/p/5304910.html