日期:2014-05-17  浏览次数:20865 次

用正则取出图片链接和图片
<a   href= "链接地址 "   target= "_blank "> <img   src= "图片地址 "   border= "0 "   alt= " "   /> </a> <a   href= "链接地址 "   target= "_blank "> 标题 </a> 属性&nbsp; <span   class= "ItemPrice "> 0.15795   文字 </span>         <a   href= "链接地址 "   target= "_blank "> <img   src= "图片地址 "   border= "0 "   alt= " "   /> </a> <a   href= "链接地址 "   target= "_blank "> 标题 </a> 属性&nbsp; <span   class= "ItemPrice "> 0.15795   文字 </span>


麻烦用正则取出图片的链接和图片的这段代码列:这段 <a   href= "链接地址 "   target= "_blank "> <img   src= "图片地址 "   border= "0 "   alt= " "   /> </a> <a   href= "链接地址 "   target= "_blank "> 标题 </a> 属性&nbsp; <span   class= "ItemPrice "> 0.15795   文字 </span> 只取 <a   href= "链接地址 "   target= "_blank "> <img   src= "图片地址 "   border= "0 "   alt= " "   /> </a>

------解决方案--------------------
<a href= "(.+) " target= "_blank "> <img src= "(.+) " border= "0 " alt= " " /> </a>