日期:2014-05-17 浏览次数:20508 次
Regex reg = new Regex(@"(?i)(?<=/)(VIP_[^/]+)/([^?\s]+)");
MatchCollection mc = reg.Matches(yourStr);
foreach (Match m in mc)
{
richTextBox2.Text += m.Groups[1].Value + "\n";
richTextBox2.Text += m.Groups[2].Value + "\n";
}
string path = "http://XXX.XXXX.XXX/XXX/VIP_XX/report/aaa.aspx?id=1";
Match match = Regex.Match(path, @"/(?i)([^/]+)/(report(/[^/?]*)*)");
Response.Write(match.Groups[1].Value + "<br/>");
Response.Write(match.Groups[2].Value);