js match方法截取某个字符串前面的内容
var verify_code=http://localhost:8080/pages/admin/order_cancellation/index?verify_code=20348287
1、指定某个字符串后面的内容
console.log(verify_code.match(/verify_code=(\S*)/)[1])
输出:20348287
2、指定某个字符串前面的内容
console.log(verify_code.match(/(\S*)verify_code=/)[1])
输出:http://localhost:8080/pages/admin/order_cancellation/index?
3、指定两个字符串之间的内容
console.log(verify_code.match(/http://localhost:8080(\S*)verify_code=/)[1])
输出:/pages/admin/order_cancellation/index?