<!--item#1 start-->
<table width=100% ><tr><td valign="top">
<table border="0" cellpadding=2 cellspacing=4>
<tr><td width="120">
<Table align="center" border="0" cellpadding="0" cellspacing="1" bgcolor="#cccccc">
<tr><td align=center bgcolor=ffffff height=100 width=100>
<a href="_Photo_Frame.html" target="_blank" title="Glass_Photo_Frame">
<!--要求1.抓取这个图片url-->
<img src="hhjk.jpg" width="100" height="100"  border="0" alt="Glas Photo Frame">
</a>
</td></tr></table>
</td>
<td valign="top">
<a href="_Frame.html"  target="_blank">Glass Photo Frame</a>&nbsp;<font class=re> [ Place of Origin:China ]</font>
<br> Specifications: 1) Sizes: 3.5 x 5", 5 x 7", 6 x 8", 8 x 10" &nbsp;&nbsp;<font class=s>[Related Products: <a name=50105179></a>
<a href="/catalogs/19/Photo_Picture_Frame.html">
Photo & Picture Frame</a>]</font>
<br>
<table width="100%" border="0" cellspacing="7" cellpadding="5">
          <tr><td style=padding-left:25px>
<b><a href="/trade/?emberId=Y25maW5lZ2lmdA%3D%3D&encode=Y" target="_blank"><font color=red>41</font> Results</a></b>
from <a href="http://finegift.en.alibaba.com" target=_blank>
Ningbo Finegift Industrial Co., Ltd.</a>
<br><a href="javascript:win=open(oldsuppliers.html', 'forbuyerchina', 'width=730,height=345,location=no,toolbar=no,status=no,resizable=yes,scrollbars=yes'); win.focus();"><img src="uppliers.gif" align="absmiddle" alt="Click here to know more about Gold Supplier!" border=0></a>
<font class=C>
<!--要求2.抓取这个open里的"trust_030325.html"-->
<a href="javascript:win=open(trust_030325.html','','width=445,height=470,location=no,toolbar=no,status=no,resizable=no,scrollbars=no');win.focus();"><img border=0  src="trustpass_logo_s.gif"></a></font>
<a href="javascript:win=open(how/~~cnfinegift?smallwin', '', 'width=380,height=466,location=no,toolbar=no,status=no,resizable=no,scrollbars=yes'); win.focus();"><img src="/chinasupply/video3.gif" border=0></a>
</font>
</td>
</tr></table>
</td>
<td valign=top nowrap class=s width="100"><input type="checkbox" value="50105179" name="chkProductIds" > Select 
</td>
    </tr></table>
<!--item#1 end-->
<!--item#2 start-->
<!--item#2 end-->
有很多类似的item#部分,
<!--要求1.抓取这个图片url-->
<!--要求2.抓取这个open里的"trust_030325.html"-->
急用....

解决方案 »

  1.   

    Regex re = new Regex(@"这里怎么写");
    foreach (Match m in re.Matches(str)){
    Console.WriteLine(m.Groups["xxxx"].Value);
    Console.WriteLine(m.Groups["yyyy"].Value);
    }
    //这里的,xxxx,yyyy怎么对应
      

  2.   

    string target = @"<(table)\s+[.\n]*>[.\n]*<(table)\s+[.\n]*>[.\n]*<img\s+src\s*=""(?<img>)""\s+[.\n]*>[.\n]*<\/.*><\/table.*>";
    我这样写能不能匹配
      

  3.   

    网上教程很多了,自己搜一下
    search.csdn.net
      

  4.   

    string target = @"^<(table)\s+.*>.*<(table)\s+.*>.*<img\s+src\s*=""(?<img>)""\s+.*>.*</table></table>$";
    我改成這樣還是不行呀