[英]JS Regex Help to match URL
我只需要匹配網址C和D。
鑒於我有這些網站:
a. http://www.website.com/our-resources/news/?p=1
b. http://www.website.com/example/voice-of-the-customer/news/?p=12
c. http://www.website.com/our-resources/news/?p=123
d. http://www.website.com/example/?p=4321
e. http://www.website.com/example/products/touchchat/news/?p=12345
我在www.regexpal.com上使用.*\\?((.*=.*)(&?[0-9]{3,4}))
,它與c,d和e匹配。
用這個:
.*\?((.*=)([0-9]{3,4}))
這是由.*=.*
的第二個.*
引起的
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.