<a hidefocus="true" class="active dropdown-tgr-mouse clearfix" href="javascript:;">
<span class="icon-btn-dsr">如实描述:</span>
<span class="num">4.41</span>
</a>
</span>
</div>
<div class="service-btns wrapper-box">
<span class="icon-pit icon-service-qitian"></span>
<span class="icon-pit icon-service-xiaobao"></span>
</div>
</div>
</div>
</div>
<div class="col item icon-datalink" nid="22646972463">
<div class="item-box">
<div class="pic">
<p class="pic-box"><a trace="auction" nid="45649864363" traceNum="2" href="http://item.taobao.com/item.htm?id=22646972463" class="s210" target="_blank">
<div class="col item icon-datalink" nid="45649864363">
<span><img src="http://img04.taobaocdn.com/bao/uploaded/i4/i4/13130032498380400/T1iIloXpXbXXXXXXXX_!!0-item_pic.jpg_210x210.jpg" /></span>
</a>
</p>
我要用正则从这段代码中 抽取 nid 的值 也就是 红色标记的内容 灰色标记的内容不取
(?<=class=\"col item icon-datalink\" nid=\")\d+
这个应该可以
写好了: nid="(\d+)">
完整的代码太长 我怕 其他地方 也有 nid="xxxxx" 这样的情况
@浣花溪: 那你就早说。 <div\sclass="col item icon-datalink" nid="(\d+)">