摘要: String.prototype.trim = function (char, type) { if (char) { if (type == 'left') { return this.replace(new RegExp('^\\'+char+'+', 'g'), ''); } else if 阅读全文
posted @ 2021-06-07 12:01 _迷途 阅读(553) 评论(0) 推荐(0) 编辑
摘要: 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])\ 阅读全文
posted @ 2021-06-07 11:54 _迷途 阅读(227) 评论(0) 推荐(0) 编辑
摘要: function clearDomScriptTag(s) { var reg=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi; //生成相关正则信息 s = s.replace(reg, "");//忽略大小写的正则 return s; 阅读全文
posted @ 2021-06-07 11:52 _迷途 阅读(698) 评论(0) 推荐(0) 编辑