js 字符串查找问题(url地址)

比如我有如下url地址 我想找出以&t=开头的,并且得到后面的数字

http://localhost:8080/search/...所有&t=1

http://localhost:8080/search/...所有&t=3

http://localhost:8080/search/...所有&t=18

因为后面的这个数字是会变的,所以我想找出这个数字


喵喔喔
浏览 610回答 1
1回答

慕村9548890

'http://localhost:8080/search/...所有&t=1123&123'.match(/.*?t=(.*?)(?=$|&.*)/)[1]'http://localhost:8080/search/...所有&t=1'.match(/.*?t=(.*?)(?=$|&.*)/)[1]
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript