(?si)<a\s+.*?>(?<title>.*?)</a> 

解决方案 »

  1.   

     MatchCollection mc = Regex.Matches(input, @"<td>[\s\S]*?target=>.*?>(.*?)</", RegexOptions.IgnoreCase);
    我这个应该怎么改呢!
      

  2.   

    using System;
    using System.Text.RegularExpressions;class Program
    {    
      static void Main()
      {
        string input = @"
    <tr> 
        <th>53 </th> 
        <td> <a href=""http://www.sogou.com/web?query=%D6%D0%B9%FA%B5%E7%D7%D3%B5%D8%CD%BC&w=01020602"" target=""_blank"">中国电子地图 </a> </td> 
        <td> <img src=""/images/hint_bar.gif"" width=""12"" height=""13""> </td> 
      </tr> 
      <tr> 
        <th>54 </th> 
        <td> <a href=""http://www.sogou.com/web?query=%D6%D0%B9%FA%C2%C1%D2%B5&w=01020602"" target=""_blank"">中国铝业 </a> </td> 
        <td> <img src=""/images/hint_bar.gif"" width=""12"" height=""13""> </td> 
      </tr> 
    ";
        MatchCollection mc = Regex.Matches(input, @"(?si)<a\b+.*?>(?<title>.*?)</a>"); 
        foreach (Match m in mc)
        {
          Console.WriteLine(m.Groups["title"].Value);
        }
      }
    }
    /* 程序输出:
    中国电子地图 
    中国铝业 
    */
      

  3.   

        MatchCollection mc = Regex.Matches(input, @"(?si)<a\b.*?>(?<title>.*?)</a>"); 
        foreach (Match m in mc)
        {
          Console.WriteLine(m.Groups["title"].Value);
        }