讲下 这个是什么意思,@"(?is)(?<=<div id=""{0}""[^>]*>).*?(?=</div>) 麻烦高手讲仔细点 新手不懂
然后在说个 可以获取一个页面的全部图片和超链接 例子如下
<div id="Product_LittleImage"><ul id="mycarousel" class="jcarousel-skin-tango"><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/4776/445a950e-4ded-444d-94bd-f418a73dcc43.jpg" name="4776/445a950e-4ded-444d-94bd-f418a73dcc43.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/2529/729d44ed-9f76-43a1-9122-2b2d50069ad4.jpg" name="2529/729d44ed-9f76-43a1-9122-2b2d50069ad4.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/2355/b4c1f8ab-aa87-4ba4-9b77-2aaeca0ec3e1.jpg" name="2355/b4c1f8ab-aa87-4ba4-9b77-2aaeca0ec3e1.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/2878/4b626f5b-8952-4fde-9231-f9728b92ce27.jpg" name="2878/4b626f5b-8952-4fde-9231-f9728b92ce27.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/2966/4468e136-88ff-4abd-a007-e51ccb9d0a9f.jpg" name="2966/4468e136-88ff-4abd-a007-e51ccb9d0a9f.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/2949/72f018d8-c32f-482b-88c3-29a3c03748cf.jpg" name="2949/72f018d8-c32f-482b-88c3-29a3c03748cf.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/4291/93adb700-df6d-4f2a-a7db-a448669db481.jpg" name="4291/93adb700-df6d-4f2a-a7db-a448669db481.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/1997/8062ff5e-11cf-4def-a88e-7365b211ef82.jpg" name="1997/8062ff5e-11cf-4def-a88e-7365b211ef82.jpg"/></li></ul>
</div>
然后在说个 可以获取一个页面的全部图片和超链接 例子如下
<div id="Product_LittleImage"><ul id="mycarousel" class="jcarousel-skin-tango"><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/4776/445a950e-4ded-444d-94bd-f418a73dcc43.jpg" name="4776/445a950e-4ded-444d-94bd-f418a73dcc43.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/2529/729d44ed-9f76-43a1-9122-2b2d50069ad4.jpg" name="2529/729d44ed-9f76-43a1-9122-2b2d50069ad4.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/2355/b4c1f8ab-aa87-4ba4-9b77-2aaeca0ec3e1.jpg" name="2355/b4c1f8ab-aa87-4ba4-9b77-2aaeca0ec3e1.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/2878/4b626f5b-8952-4fde-9231-f9728b92ce27.jpg" name="2878/4b626f5b-8952-4fde-9231-f9728b92ce27.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/2966/4468e136-88ff-4abd-a007-e51ccb9d0a9f.jpg" name="2966/4468e136-88ff-4abd-a007-e51ccb9d0a9f.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/2949/72f018d8-c32f-482b-88c3-29a3c03748cf.jpg" name="2949/72f018d8-c32f-482b-88c3-29a3c03748cf.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/4291/93adb700-df6d-4f2a-a7db-a448669db481.jpg" name="4291/93adb700-df6d-4f2a-a7db-a448669db481.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-TSI 14.0英寸笔记本电脑(T6600 2G 320G 512M独显 D刻 蓝牙 WIN7)" src="http://img10.360buyimg.com/S5/1997/8062ff5e-11cf-4def-a88e-7365b211ef82.jpg" name="1997/8062ff5e-11cf-4def-a88e-7365b211ef82.jpg"/></li></ul>
</div>
(?= </div>) 是以 </div>结尾,也是不匹配</div>中间的很明显,查查就知道
http://www.unibetter.com/deerchao/zhengzhe-biaodashi-jiaocheng-se.htm
上面这个正则我想请问各位大虾 是什么意思 ?:指的是不是:有可能出现,也有可能不出现 , [^ /]是不是指的不包含 /符号 而外面的 /* 又是什么意思,还有最后一个+ 有是什么意思,希望能够帮我解答,最好能够讲全点,这样我好理解点。。
[^/]匹配除了/以外的字符
*表示匹配0次到无穷次
+表示至少匹配1次
建议楼主去看看基本语法
http://blog.csdn.net/lxcnn/archive/2009/06/14/4268033.aspx
小第还有一个问题想请教下你,我要获取第首先我到获取到 class="right"这个DIV 里面的第一个DIV内容(备注:class="Product_Name")以及 id="Product_Intro_Right 这两个DIV的内容
最后就是 在这个class="right DIV结束后还有三个DIV 我也要获取这三个DIV后面的内容, 后面的HTML代码然后不要,替换为空
<div class="right">
<div class="Product_Intro">
<!--[if !IE]>商品简介左部开始<![endif]-->
<div class="Product_Name"><h1>联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)</h1><font color="#FF0000" >赠联想09款单肩包!</font>
</div>
<div id="Product_Intro_Left" ><div id="Product_BigImage" class="jqzoom" onclick = "window.open('http://www.360buy.com/bigimage.aspx?id=185810')"><img onerror = "this.src='http://www.360buy.com/images/none/none_347.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S1/2675/5aeceec5-ba3d-4fee-bb7b-f17ef34180ab.jpg" width="349" jqimg="http://img10.360buyimg.com/S0/2675/5aeceec5-ba3d-4fee-bb7b-f17ef34180ab.jpg"/>
</div>
<div id="Product_LittleImage"><ul id="mycarousel" class="jcarousel-skin-tango"><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/1829/60221b28-3dc5-431f-bcaa-5fde46bb81b6.jpg" name="1829/60221b28-3dc5-431f-bcaa-5fde46bb81b6.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/4043/acc59b2d-cd2a-4002-9831-1712f7cd20fa.jpg" name="4043/acc59b2d-cd2a-4002-9831-1712f7cd20fa.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/2614/d173e110-3542-4b45-aaa5-65365dab8d39.jpg" name="2614/d173e110-3542-4b45-aaa5-65365dab8d39.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/1186/86308e85-378d-420c-a6d0-0e8507c5e436.jpg" name="1186/86308e85-378d-420c-a6d0-0e8507c5e436.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/1987/24a71915-8e0c-4aa2-8a03-2409e3dcf593.jpg" name="1987/24a71915-8e0c-4aa2-8a03-2409e3dcf593.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/3765/6ac43bf3-527b-4c92-8b36-6c9068443a5a.jpg" name="3765/6ac43bf3-527b-4c92-8b36-6c9068443a5a.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/1518/c9211ebc-0580-4fdc-b42e-d473f007814b.jpg" name="1518/c9211ebc-0580-4fdc-b42e-d473f007814b.jpg"/></li><li><img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/2675/5aeceec5-ba3d-4fee-bb7b-f17ef34180ab.jpg" name="2675/5aeceec5-ba3d-4fee-bb7b-f17ef34180ab.jpg"/></li></ul>
</div>
<div id="Product_Opp"><img alt="点此看大图" src="http://misc.360buyimg.com/skin/df/i/zoom.gif" /> <a class="link_1" onerror = "this.src='http://www.360buy.com/images/none/none_150.gif'" target="_blank" href="http://www.360buy.com/bigimage.aspx?id=185810">点此看大图</a> <img alt="推荐给好友"src="http://misc.360buyimg.com/skin/df/i/ico_tuijian.gif" width="14" height="14" /> <a href='http://club.360buy.com/jdFriend/tjyl.aspx?product=185810' class="link_1" target='_blank'>推荐给好友</a>
</div>
</div>
<!--[if !IE]>商品简介左部结束<![endif]-->
<!--[if !IE]>商品简介右部开始<![endif]-->
<div id="Product_Intro_Right"><ul class="Pro_baseinfo"><li>市 场 价:<em class="m_line">¥7,499.00</em> <em class="grey">商品编号:185810</em></li><li>京 东 价:<img onerror = "this.src='http://www.360buy.com/images/no2.gif'" src ="http://price.360buy.com/P74BCF85C28D20DA1A657B49CCA36F543,3.png"/><span id="promotion1" style="padding:0 12px;"></span><a target="_blank" class="link_1" href="http://jd2008.360buy.com/notify.aspx?id=185810&type=1&key=74BCF85C28D20DA1A657B49CCA36F543"">
</div>
</div><!--class="right 这个DIV结束--> 这里假设后面还有三个 DIV
<div id="div1"></div>
<div id="div2"></div>
<div id="div3"></div>
这后面是不要的代码
<body>
<html>
小第还有一个问题想请教下你,我要获取第首先我到获取到 class="right"这个DIV 里面的第一个DIV内容(备注:class="Product_Name")以及 id="Product_Intro_Right 这两个DIV的内容
最后就是 在这个class="right DIV结束后还有三个DIV 我也要获取这三个DIV后面的内容, 后面的HTML代码然后不要,替换为空
<div class="right"> <div class="Product_Intro">
<!--[if !IE]>商品简介左部开始 <![endif]-->
<div class="Product_Name"> <h1>联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7) </h1> <font color="#FF0000" >赠联想09款单肩包! </font>
</div>
<div id="Product_Intro_Left" > <div id="Product_BigImage" class="jqzoom" onclick = "window.open('http://www.360buy.com/bigimage.aspx?id=185810')"> <img onerror = "this.src='http://www.360buy.com/images/none/none_347.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S1/2675/5aeceec5-ba3d-4fee-bb7b-f17ef34180ab.jpg" width="349" jqimg="http://img10.360buyimg.com/S0/2675/5aeceec5-ba3d-4fee-bb7b-f17ef34180ab.jpg"/>
</div>
<div id="Product_LittleImage"> <ul id="mycarousel" class="jcarousel-skin-tango"> <li> <img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/1829/60221b28-3dc5-431f-bcaa-5fde46bb81b6.jpg" name="1829/60221b28-3dc5-431f-bcaa-5fde46bb81b6.jpg"/> </li> <li> <img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/4043/acc59b2d-cd2a-4002-9831-1712f7cd20fa.jpg" name="4043/acc59b2d-cd2a-4002-9831-1712f7cd20fa.jpg"/> </li> <li> <img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/2614/d173e110-3542-4b45-aaa5-65365dab8d39.jpg" name="2614/d173e110-3542-4b45-aaa5-65365dab8d39.jpg"/> </li> <li> <img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/1186/86308e85-378d-420c-a6d0-0e8507c5e436.jpg" name="1186/86308e85-378d-420c-a6d0-0e8507c5e436.jpg"/> </li> <li> <img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/1987/24a71915-8e0c-4aa2-8a03-2409e3dcf593.jpg" name="1987/24a71915-8e0c-4aa2-8a03-2409e3dcf593.jpg"/> </li> <li> <img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/3765/6ac43bf3-527b-4c92-8b36-6c9068443a5a.jpg" name="3765/6ac43bf3-527b-4c92-8b36-6c9068443a5a.jpg"/> </li> <li> <img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/1518/c9211ebc-0580-4fdc-b42e-d473f007814b.jpg" name="1518/c9211ebc-0580-4fdc-b42e-d473f007814b.jpg"/> </li> <li> <img onerror = "this.src='http://www.360buy.com/images/none/none_50.gif'" alt="联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)" src="http://img10.360buyimg.com/S5/2675/5aeceec5-ba3d-4fee-bb7b-f17ef34180ab.jpg" name="2675/5aeceec5-ba3d-4fee-bb7b-f17ef34180ab.jpg"/> </li> </ul>
</div>
<div id="Product_Opp"> <img alt="点此看大图" src="http://misc.360buyimg.com/skin/df/i/zoom.gif" /> <a class="link_1" onerror = "this.src='http://www.360buy.com/images/none/none_150.gif'" target="_blank" href="http://www.360buy.com/bigimage.aspx?id=185810">点此看大图 </a> <img alt="推荐给好友"src="http://misc.360buyimg.com/skin/df/i/ico_tuijian.gif" width="14" height="14" /> <a href='http://club.360buy.com/jdFriend/tjyl.aspx?product=185810' class="link_1" target='_blank'>推荐给好友 </a>
</div>
</div> <!--[if !IE]>商品简介左部结束 <![endif]-->
<!--[if !IE]>商品简介右部开始 <![endif]-->
<div id="Product_Intro_Right"> <ul class="Pro_baseinfo"> <li>市 场 价: <em class="m_line">¥7,499.00 </em> <em class="grey">商品编号:185810 </em> </li> <li>京 东 价: <img onerror = "this.src='http://www.360buy.com/images/no2.gif'" src ="http://price.360buy.com/P74BCF85C28D20DA1A657B49CCA36F543,3.png"/> <span id="promotion1" style="padding:0 12px;"> </span> <a target="_blank" class="link_1" href="http://jd2008.360buy.com/notify.aspx?id=185810&type=1&key=74BCF85C28D20DA1A657B49CCA36F543"">
</div>
</div> <!--class="right 这个DIV结束--> 这里假设后面还有三个 DIV
<div id="div1"> </div>
<div id="div2"> </div>
<div id="div3"> </div>
这后面是不要的代码
<body>
<html>
<div id="right">
<div id="div1">这里中间会有很多DIV</div>
<div id="div1">这里中间会有很多DIV</div>
<div id="div1">这里中间会有很多DIV</div>
</div>
这是我想要的内容就下面这两个DIV里面的全部内容
<div class="sbox_3"></div>
<div class="info></div>
在后面的全是不要HTML的代码帮我干掉
werewreddsfsdfsdfsdfsd
</body>
</html>
<div class="info> </div>
例如
<div id="right">
<div id="div1">这的内容我不要只是代替HTML</div>
<div id="div1">这的内容我不要只是代替HTML </div>
<div id="div1">这的内容我不要只是代替HTML</div>
</div>
<div class="">我要的内容1</div>
<div class="">我要的内容2</div>
<div class="">我要的内容3</div>后面的代码也不要
你想取到内容的那3个div的class是不是指定的?
意思就是要取大DIV 结束后面连续三个DIV内容 ID或者什么CLASS 不用指定 你就当是随便的代码用*代表吧
大div里面还有嵌套的div的话不知道怎么才能判断出大div结束 只能通过制定的class和id来取值了
不过 <div class="right">这个DIV里面是嵌套了几个DIV 不知道判断当前 class="right" 的结束标记要不要获取里面有几个小的DIV 呀?
<div class="">
<div>
内容
</div>
</div>
<div class="right">
<div>这里不会再有嵌套</div>
<div>这里不会再有嵌套</div>
<div>这里不会再有嵌套</div>
</div>
{
string str = @"就是有一个大DIV 里面嵌套很多DIV 但是我不要里面的内容 我要这个大DIV结束后面的那三个DIV的内容
例如
<div id='right'>
<div id='div1'>这的内容我不要只是代替HTML </div>
<div id='div1'>这的内容我不要只是代替HTML </div>
<div id='div1'>这的内容我不要只是代替HTML </div>
</div>
<div class=''>我要的内容1 </div>
<div class=''>我要的内容2 </div>
<div class=''>我要的内容3 </div> 后面的代码也不要 ";
Regex reg = new Regex(@"(?is)(?<=.*</div>[^<>]*</div>.*<div[^>]*>).*?(?=</div>)");
foreach (Match m in reg.Matches(str))
{
MessageBox.Show(m.Value);
}
}
<li id="EFF_PINFO_Option_0" class="curr" onclick="SwitchTab('EFF_PINFO_','0','','S1')"><em>商品介绍</em></li>
<li id="EFF_PINFO_Option_1" onclick="SwitchTab('EFF_PINFO_','1','','S1')"><em>规格参数</em></li>
<li id="EFF_PINFO_Option_2" onclick="SwitchTab('EFF_PINFO_','2','','S1')"><em>包装清单</em></li>
<li id="EFF_PINFO_Option_11" onclick="SwitchTab('EFF_PINFO_','11','','S1')"><em>售后服务</em></li>
</ul>
<!--外层大DIV开始--->
<div class="sbox_3" id="EFF_PINFO_Con_0"><ul class='Detail1'><li class='w100'title='联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4G 320G 512M独显 D刻 蓝牙 遥控器 WIN7)'>商品名称:联想(Lenovo)Y450A-PEI 14.0英寸笔记本电脑 (P8700 4...</li><li>生产厂家:<a target="_blank" href="http://www.360buy.com/brand/%e8%81%94%e6%83%b3.html">联想</a></li></ul>
<!--(嵌套1开始)-->
<div class="ProInfo"><DIV>
<P>IdeaPad 新品以 <STRONG>全新时尚的家族</STRONG><STRONG>Family ID</STRONG><STRONG>设计</STRONG><STRONG>+</STRONG><STRONG>尖端科技的娱乐应用设计</STRONG><STRONG>+</STRONG><STRONG>体贴入微的人性关怀设计</STRONG>,在娱乐体验、多媒体享乐方面保持一贯的创新意识,给用户带来影音娱乐的时尚精品。</P>
</DIV><!--(嵌套1结束)--> <!--(嵌套2开始)-->
<DIV><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-font-kerning: 1.0pt; mso-fareast-font-family: 宋体">LED</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-family: Arial; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-font-kerning: 1.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">背光液晶屏,不但整合了强大的影音、娱乐功能,同时带给用户耳目一新的操控乐趣。时尚外观强劲性能,满足用户对于时尚外观与丰富多媒体娱乐需求,是时尚性、便携性和娱乐性完美结合的产品,真正贴身娱乐伙伴。</SPAN>
</DIV><!--(嵌套2结束)--> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD style="PADDING-RIGHT: 10px" vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD vAlign=top align=left width=137><IMG height=86 alt="" src="http://img20.360buyimg.com/ImgUpload/2009113/2009113102231977999.jpg" width=127></TD>
<TD vAlign=top><STRONG><STRONG>超凡影院级视觉享受</STRONG><STRONG>——16</STRONG><STRONG>:</STRONG><STRONG>9</STRONG><STRONG>黄金比例,</STRONG><STRONG>LED</STRONG><STRONG>背光液晶屏</STRONG></STRONG><BR>IdeaPad Y450笔记本屏幕采用14" 16:9黄金分割比例,大屏幕大视野,更适合高清影片和视频的播放,完全没有显示黑边,是真正的宽屏幕移动家庭影院,配合给您超凡的视觉享受。LED背光技术使屏幕色彩柔和,完全不含重金属汞更环保,功耗更低更节能。</TD></TR></TBODY></TABLE><!--嵌套3开始-->
<DIV>IdeaPad Y450非常注重人机交互自由流畅,联想slide bar桌面导航给您带来耳目一新的操控娱乐新体验。您可以把常用的应用程序图标放置在联想桌面导航的托盘中,让您的电脑桌面更干净。独特slide bar触控条设计,让您在指尖轻触间就能享受到高科技设计带来的轻松惬意的操控享受,快捷地调用各种应用程序。
</DIV><!--嵌套3结束-->
<!--嵌套4结束-->
<div>
DIV4内容DIV4内容DIV4内容DIV4内容DIV4内容DIV4内容
</div>
<!--嵌套4开始-->
</div>
foreach (Match m in reg.Matches(str))
{
Console.WriteLine(m.Value);
}
Console.Read();
foreach (Match m in reg.Matches(str))
{
Console.WriteLine(m.Value);
}
Console.Read();
这事情搞定我一定好好学正则,
下面我要获取京 东 价:后面这个图片地址怎么获取呀
<div id="Product_Intro_Right"><ul class="Pro_baseinfo"><li>市 场 价:<em class="m_line">¥7,499.00</em> <em class="grey">商品编号:185810</em></li><li>京 东 价:<img onerror = "this.src='http://www.360buy.com/images/no2.gif'" src ="http://price.360buy.com/P74BCF85C28D20DA1A657B49CCA36F543,3.png"/><span id="promotion1" style="padding:0 12px;">
</div>