for (int i = 0; i < 10; i++)
{
MatchCollection mc = Regex.Matches(html, @"<li class=['""]top-"+i.ToString()+@"['""]>(?<text>[\s\S]*?)</li>",RegexOptions.IgnoreCase);
string chulihtml = "";
foreach (Match m in mc)
{
chulihtml = m.Groups["text"].Value;
break;
}
{
MatchCollection mc = Regex.Matches(html, @"<li class=['""]top-"+i.ToString()+@"['""]>(?<text>[\s\S]*?)</li>",RegexOptions.IgnoreCase);
string chulihtml = "";
foreach (Match m in mc)
{
chulihtml = m.Groups["text"].Value;
break;
}
}
注意 @号