62,269
社区成员
发帖
与我相关
我的任务
分享
string Week = "周一|周二|周三|周四|周五|周六|周日";
string WeekPattern = "(" + Week + ")?";
string input = "在周二";
MatchCollection mc = Regex.Matches(input, WeekPattern, RegexOptions.Compiled);
for (int j = 0; j < mc.Count; j++)
{
GroupCollection time = mc[j].Groups;
for (int i = 0; i < time.Count; i++)
{
Response.Write("Match["+j+"] time[" + i + "].Value:" + time[i].Value + " <br/>");
}
}
string str = mm.Groups["Week"].Value.ToString().Trim();
string strstrMusicTopContent = @"<td width=""17%"" height=""28"" bgcolor=""#FFFFFF"" class=""border""><a href=""(?<url>[^""]+)""[^>]*>";
MatchCollection MT = Regex.Matches(strMusicTopText, strstrMusicTopContent, RegexOptions.IgnoreCase | RegexOptions.Compiled);
foreach (Match mm in MT)
{
strTopArr[xxx] = mm.Groups["url"].Value.ToString().Trim();
}