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

正则表达式解析内容
<p class="brand"></p>
<a href="http://www.newegg.com.cn/Product/A19-227-2G8.htm"><img src="http://c1.neweggimages.com.cn/neweggpic2/neg/P144/A19-227-2G8.jpg?v=C1A36AC149B747A69089" title="Leadtek&#32;丽台" /></a>
</dt>

我要解析到的内容是
http://www.newegg.com.cn/Product/A19-227-2G8.htm
http://c1.neweggimages.com.cn/neweggpic2/neg/P144/A19-227-2G8.jpg?v=C1A36AC149B747A69089

另外,解析字符要从<p class="brand"></p>开始找,自己写了很久都只能解析出一点,后面卡住了。请帮忙

这是我写的:(?is)[^<p\s+class=\"brand\"></p>][^<a\s+href=\"](.*)

------解决方案--------------------
(?is)(?<=<p[\s\S]*?class="brand">.*?</p>).*?<a[\s\S]*?href="([^"]*?)"[\s\S]*?><img[\s\S]*?src="([^"]*?)"[\s\S]*?/?></a>