21,887
社区成员
发帖
与我相关
我的任务
分享
<tr onMouseOver="overCell(this);" onMouseOut="outCell(this);"><td width="30%" class=style2><a href="/products/50-00-0.htm" class=blue //onclick="blur()">
CAS#
</a></td><td width="70%" class=style2>
化学名
</td></tr>
<tr onMouseOver="overCell(this);" onMouseOut="outCell(this);"><td width="30%" class=style2><a href="/products/50-00-0.htm" class=blue //onclick="blur()">
CAS#
</a></td><td width="70%" class=style2>
化学名
</td></tr>
<tr onMouseOver="overCell(this);" onMouseOut="outCell(this);"><td width="30%" class=style2><a href="/products/50-00-0.htm" class=blue //onclick="blur()">
CAS#
</a></td><td width="70%" class=style2>
化学名
</td></tr>
<tr onMouseOver="overCell(this);" onMouseOut="outCell(this);">
<td width="30%" class=style2>
<a href="/products/50-00-0.htm" class=blue onclick="blur()">50-00-0</a>
</td>
<td width="70%" class=style2>
Formaldehyde
</td>
</tr><tr onMouseOver="overCell(this);" onMouseOut="outCell(this);">
<td width="30%" class=style2>
<a href="/products/50-01-1.htm" class=blue onclick="blur()">50-01-1</a>
</td>
<td width="70%" class=style2>
Guanidine hydrochloride
</td>
</tr>
我使用jordan的正则表达式获取到的数组是空的,请问是怎么回事,本人是正则表达式菜鸟,请多多包涵
谢谢$s=<<<html
<tr onMouseOver="overCell(this);" onMouseOut="outCell(this);"><td width="30%" class=style2><a href="/products/50-00-0.htm" class=blue //onclick="blur()">
CAS#
</a></td><td width="70%" class=style2>
化学名
</td></tr>
<tr onMouseOver="overCell(this);" onMouseOut="outCell(this);"><td width="30%" class=style2><a href="/products/50-00-0.htm" class=blue //onclick="blur()">
CAS#
</a></td><td width="70%" class=style2>
化学名
</td></tr>
<tr onMouseOver="overCell(this);" onMouseOut="outCell(this);"><td width="30%" class=style2><a href="/products/50-00-0.htm" class=blue //onclick="blur()">
CAS#
</a></td><td width="70%" class=style2>
化学名
</td></tr>
html;
preg_match_all('/>([^>]+)<\/a><\/td><td width="70%" class=style2>(.+)<\/td>/isU',$s,$m);
print_r($m);