日期:2014-05-18  浏览次数:20440 次

大家帮忙给我分析一下这样的数据^_^
需要分析的地址:
http://my.taobao.com/mytaobao/rate/rate.htm?user_id=b0dd5f1e1f9045c7eeec5c3836c49b2d&detailed=1&good_neutral_or_bad=1&time_line=-365&received_or_posted=0&buyer_or_seller=0#RateType

需要将这样的代码 <div   class= "ItemName ">
<a   href= "http://auction1.taobao.com/auction/snap_detail.htm?item_id=f4b54bb11be3fdea1688f6c93bfaa840&snap_id=JL7T4B64KBV24SLV7AQP6NU6VI&x_id=db2 "   title= "自动售卡武林外传30金元宝完美世界30元完美国际版诛仙仅售25.5 "     target= "_blank ">
自动售卡武林外传30金元宝完美世...
  </a>
</div>

转化为:

<div   class= "ItemName ">
<a   href= "http://auction1.taobao.com/auction/snap_detail.htm?item_id=f4b54bb11be3fdea1688f6c93bfaa840&snap_id=JL7T4B64KBV24SLV7AQP6NU6VI&x_id=db2 "   title= "自动售卡武林外传30金元宝完美世界30元完美国际版诛仙仅售25.5 "     target= "_blank ">
自动售卡武林外传30金元宝完美世界30元完美国际版诛仙仅售25.5
  </a>
</div>

然后每条循环入库^_^


------解决方案--------------------
Regex.Replace(@ " <div class= " "ItemName " "> <a href= " "http://auction1.taobao.com/auction/snap_detail.htm?item_id=f4b54bb11be3fdea1688f6c93bfaa840&snap_id=JL7T4B64KBV24SLV7AQP6NU6VI&x_id=db2 " " title= " "自动售卡武林外传30金元宝完美世界30元完美国际版诛仙仅售25.5 " " target= " "_blank " "> 自动售卡武林外传30金元宝完美世... </a> </div> ", @ "(? <begin> <a\s*[^> ]*?title= " "?(? <title> [^ " "]*) " "?[^> ]*> )[^ <]*(? <end> </a> ) ", "${begin}${title}${end} ",RegexOptions.IgnoreCase)


要这样替换?