正則截取url參數

截取v參數的值

1.s參數后帶&

2.s參數結尾

var matchReg =/([&|?]s)=[^&]*/g


console.log('?test=test&s=we&type=long'.match(matchReg))

console.log('?s=we&type=long'.match(matchReg))
发布了91 篇原创文章 · 获赞 76 · 访问量 44万+

猜你喜欢

转载自blog.csdn.net/u013291076/article/details/87928667
今日推荐