条件不是很清楚,把你需要解释的HTML多贴些上来

解决方案 »

  1.   

    \<table.*?\>.*?标志.*?\<\/table\>\<a.*?href=\".*?.www.sina.com*?\"\>.*?\<\/a\>
      

  2.   

    <table><a href=http://www.sinocars.com>华夏</a></table><table>
    <tr><td>标志</td></tr>
    <tr><td>
    <a id=aw1 href=http://www.sinocars.com>华夏</a>
    <a id=aw2 href=http://www.163car.com>汽车</a>
    </table>比如这个,我需要得到http://www.sinocars.com这个网址的id号,aw1。
      

  3.   

    我需要解释的html页里还有很多tr td font什么的
      

  4.   

    try
    string s = @"<table><tr><td><a href=http://www.sinocars.com>华夏</a></table><table>
    <tr><td>标志</td></tr>
    <tr><td>
    <a id=aw1 href=http://www.sinocars.com>华夏</a>
    <a id=aw2 href=http://www.163car.com>汽车</a>
    <a id=aw3 href=http://www.sinocars.com>华夏</a>
    </table>"; Regex re = new Regex(@"<table(?>标志(?<NOTE>)|<table(?<TBL>)|<a id=(?<ids>\S+) href=http://www.sinocars.com>|[\S\s])*(?(TBL)(?!))(?(NOTE)|(?!))</table>", RegexOptions.IgnoreCase);
    foreach (Match m in re.Matches(s))
    foreach (Capture c in m.Groups["ids"].Captures)
    Console.WriteLine(c.Value);
      

  5.   

    谢谢思归,你的我已经测试了,但是现在页面里的<a>标签里是如下:
    <a id=aw2 href=/url?sa=l&q=http://www.synlead.com.cn&ai=BNxRonTXlQcuJFb-6YOyrlLIJ3JrNCKKpoZsB2uzHhwKQgxkQAhgCKAg4AEDsEEicOcgBAQ&num=2 onMouseOver="return ss('键连至 www.synlead.com.cn')" onMouseOut="cs()" target=nw><font size=+0>SynleadCRM为您赢得利润</font></a>能改一下么?真不好意思