我希望能匹配<TD align="center"><font color=green>……</font></TD>与<TD align="center"><font color=red>……</font></TD>中省略号
部分的信息,如下文中的:359M、410M,用一正则表达式实现。
</TR>
<TD><A href="http://www.ep8.net/ll.html" target=_blank>电视剧</A></TD>
<TD align="center"><b><font color=red>353</font></b></TD>
<TD align="center"><b><font color=red>548</font></b></TD>
<TD align="center"><font color=green>359M</font></TD>
<TD noWrap>2005-9-15 13:49</TD>
</TR>
<TR>
<TD><A href="http://www.liall.com/jj.htm" target=_blank>电影</A></TD>
<TD align="center"><b><font color=red>273</font></b></TD>
<TD align="center"><b><font color=red>415</font></b></TD>
<TD align="center"><font color=red>401M</font></TD>
<TD noWrap>2005-9-19 4:20</TD>
</TR>

解决方案 »

  1.   

    ([^<TD align="center"><font color=green>]*<TD align="center"><font color=green>)
    ([^</font></TD>]+)(</font></TD>)
      

  2.   

    正则表达式如下:
    (<TD align="center">(<b>)?<font color=(\w)*>)(\d+M?)(</font>(</b>)?</TD>)
    的Group4
    程序如下:
    string txt = "(<TD align=\"center\">(<b>)?<font color=(\\w)*>)(\\d+M?)(</font>(</b>)?</TD>)";
    Regex reg = new Regex(txt);

    MatchCollection mc = reg.Matches("你的html");
    foreach (Match m in mc) 
    {
    this.textBox2.Text +=  m.Groups[4].Value + "\r\n";
    }
      

  3.   

    以上两位朋友给出的表达式,我运行时都存在错误,难道是你们用C#,而我用VB.net就不能通过?
      

  4.   

    dim s as string = ""
    dim re as New Regex("<TD align=""center"">\s*<font color=(red|green)>\s*(?<content>[^<]*?)\s*</font>\s*</TD>", RegexOptions.IgnoreCase)
    dim mc as MatchCollection  = re.Matches(s)
    for each m as Match in mc
     Console.WriteLine( m.Groups("content").Value)
    next