摘要:
String.prototype.trim = function (char, type) { if (char) { if (type == 'left') { return this.replace(new RegExp('^\\'+char+'+', 'g'), ''); } else if 阅读全文
摘要:
function is_ip(ip){ let re = /^([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\ 阅读全文
摘要:
function clearDomScriptTag(s) { var reg=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi; //生成相关正则信息 s = s.replace(reg, "");//忽略大小写的正则 return s; 阅读全文