这是我的微信公众号全是技术文章:
getUrl(){const URL = window.location.hrefconst regex = /user_id=([0-9]{1,20})/;//0-9代表0-9的任意数字,1-20表示1-20位数字const str = URLlet m;if ( (m = regex.exec(str)) !== null) {console.log(m[1])//m[1]就是截取出来的参数,这是指定}}
时间:2018-09-06 23:09:09
这是我的微信公众号全是技术文章:
getUrl(){const URL = window.location.hrefconst regex = /user_id=([0-9]{1,20})/;//0-9代表0-9的任意数字,1-20表示1-20位数字const str = URLlet m;if ( (m = regex.exec(str)) !== null) {console.log(m[1])//m[1]就是截取出来的参数,这是指定}}
正则表达式获取url后面的参数截取微信支付code值(微信内置浏览器里使用微信支付)
2023-09-15
php正则表达式匹配url参数 匹配URL的正则表达式(推荐)
2020-03-01