你给的例子,<ul   class="Mlist"> 这个没有结束标志,我就根据它取后面的<ol>...</ol>了
如果有不符合的,给出例子Match m = Regex.Match(str, @"(?<=<h1>[^<]*</h1>\s*<ul\s*class=""Mlist"">)(\s*<ol>[\s\S]*?</ol>)*", RegexOptions.IgnoreCase);
if (m.Success)
{
    string content = m.Value;   //第一次匹配内容
    MatchCollection mc = Regex.Matches(content, @"<a.*?href=""(?<url>[^""]*)""[^>]*>(?<text>[^<>]*)</a>", RegexOptions.IgnoreCase);
    foreach (Match ma in mc)
    {
        Console.WriteLine(ma.Groups["url"].Value);  //链接
        Console.WriteLine(ma.Groups["text"].Value);  //文字
    }
}

解决方案 »

  1.   

    不知道lz为什么要先分析出这些html然后再取连接和文字,好像第一步是多余的...
      

  2.   

    第二个参考
    string content = 内容;            string regex = "<ul[^>]+?>[\\s\\S]+?<li>\\s*<a[\\s\\S]+?href=\"(?<src>.*?)\"[\\s\\S]*?>(?<desc>[^<]+?)</a>" +
    "\\s*</li";
                System.Text.RegularExpressions.RegexOptions options = ((System.Text.RegularExpressions.RegexOptions.IgnorePatternWhitespace | System.Text.RegularExpressions.RegexOptions.Multiline)
                            | System.Text.RegularExpressions.RegexOptions.IgnoreCase);
                System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(regex, options);            System.Text.RegularExpressions.MatchCollection resultes = reg.Matches(content);            foreach (System.Text.RegularExpressions.Match item in resultes)
                {
                    string src = item.Groups["src"].Value;
                    string desc = item.Groups["desc"].Value;
                }
      

  3.   

    这样应该就可以满足第一个<h1>[^<]+?</h1>[\s\S]+?\<ul[\s\S]+?\</ul>
      

  4.   

    链接用这个:"href=\"([\S]+)\""
    文字用这个:">([\u4e00-\u9fa5]+)<"
      

  5.   

    .InnerText  就完了,用得着正则吗?