我只需要匹配 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。
请您参考如下方法: