比如我有如下url地址 我想找出以&t=开头的,并且得到后面的数字http://localhost:8080/search/...所有&t=1http://localhost:8080/search/...所有&t=3http://localhost:8080/search/...所有&t=18因为后面的这个数字是会变的,所以我想找出这个数字
1 回答

慕村9548890
TA贡献1884条经验 获得超4个赞
'http://localhost:8080/search/...所有&t=1123&123'.match(/.*?t=(.*?)(?=$|&.*)/)[1]
'http://localhost:8080/search/...所有&t=1'.match(/.*?t=(.*?)(?=$|&.*)/)[1]
添加回答
举报
0/150
提交
取消