C# 需要有关正则表达式helicon规则的帮助吗

C# 需要有关正则表达式helicon规则的帮助吗,c#,asp.net,regex,iis,C#,Asp.net,Regex,Iis,我需要一些关于正则表达式的帮助,因为我正在helicon中编写一个新规则 示例url将有文件名和查询字符串参数,我希望两者都匹配 www.testwebsite.com/hello.aspx?filename=/test.asp&employeeid=2100&age=20 在上面的url中,我想检查它是否是hello.aspx,是否有查询字符串filename=/test.asp 文件名可以是querystring中的任意位置 我想将上面的url拆分为其他页面 mynewp

我需要一些关于正则表达式的帮助,因为我正在helicon中编写一个新规则

示例url将有文件名和查询字符串参数,我希望两者都匹配

www.testwebsite.com/hello.aspx?filename=/test.asp&employeeid=2100&age=20 
在上面的url中,我想检查它是否是hello.aspx,是否有查询字符串
filename=/test.asp

文件名可以是querystring中的任意位置

我想将上面的url拆分为其他页面

mynewpage.aspx $2$3 etc///
我写了下面的url,但它不工作,它匹配所有的模式,比如sample1.aspx或任何文件名

(.*)(\/hello.aspx\?+)(.*)(filename=\/test\.asp)(.*)
任何帮助都将不胜感激

您需要的是:

如果你想获得所有的成功,你可以这样做:

string queryString = (new Uri("...")).Query;
NameValueCollection parameters = HttpUtility.ParseQueryString(queryString);
parameters.Get("filename");
parameters.Get("employeeid");
parameters.Get("age");

@dan我没有在中获取所有查询字符串值$3@i还需要employeeid和年龄。哦,对不起,我忘了。文件名、员工id和年龄是否总是按此顺序显示?您能否指定希望在组$3中捕获的具体内容?
string queryString = (new Uri("...")).Query;
NameValueCollection parameters = HttpUtility.ParseQueryString(queryString);
parameters.Get("filename");
parameters.Get("employeeid");
parameters.Get("age");