摘要: ?=、?<=的使用举例 var str = "XXXX (程序员)"; var newStr,regExp; regExp = /(?<=().*(?=))/; newStr = str.match(regExp) console.log(newStr);//程序员 exp1(?=exp2):查找 阅读全文
posted @ 2021-01-19 10:26 Qionghuihe 阅读(2078) 评论(0) 推荐(0) 编辑
摘要: 1.替换url参数值 function replaceUrl(url, arg, val){ var pattern = arg+'=([^&]*)'; var replaceText = arg+'='+val; return url.match(pattern) ? url.replace(ev 阅读全文
posted @ 2021-01-19 10:07 Qionghuihe 阅读(559) 评论(0) 推荐(0) 编辑