我有我在我的网站上使用的这个正则表达式
^.*/([a-z0-9,-]+)/([a-z0-9,-]+)/$
我的问题是谁可以在我的正则表达式中使用查询字符串,
/about-us/contact/?l=en -> page.aspx?id=12&l=en
其中 id=1 = /about-us/contact/
其中 l=en = /?l=en
编辑:
^.*/([a-z0-9,-]+)/([a-z0-9,-]+)/(\?l=en)
我收到错误:\ i C#
正则表达式中有没有办法判断 ?x=x 是否存在正则表达式是否匹配,但如果 ?x=x 不存在 /about-us/contact/ 的正则表达式是否匹配?
谢谢,