<TD style="BORDER-BOTTOM: windowtext 1pt solid; BORDER-LEFT: windowtext 1pt solid; BACKGROUND-COLOR: transparent; WIDTH: 110pt; HEIGHT: 15.75pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1pt solid" class=xl84 height=21 width=146><FONT size=3>2011/11/25</FONT></TD>我现在要找到上面这个<TD>里面的2011/11/25,    
 2011/11/25的外标签也有可能 是span..之类的文字标签,有没有通用的正则????

解决方案 »

  1.   

          string tempStr = File.ReadAllText(@"C:\Documents and Settings\Administrator\桌面\Test.txt", Encoding.GetEncoding("GB2312"));
                string text = Regex.Replace(tempStr,@"<[^>]+>?","");
                //2011/11/25
      

  2.   

    string s = File.ReadAllText(Server.MapPath("~/test.txt"));
    Match match = Regex.Match(s, @"(?is)<td[^>]*?>\s*<(font|span)[^>]*?>\s*(.*?)</\1>\s*</td>");
    Response.Write(match.Groups[2].Value);
      

  3.   

    (?is)(?<=<td[^>]*?>\s*<(font|span)[^>]*?>)[^<]+