正则匹配TABLE

[b]Eclipse 正则表达式 插件[/b]
[url]http://myregexp.com/eclipsePlugin.html[/url]
[url]http://www.brosinski.com/regex/[/url]

[b]源码[/b]
<tr valign="middle" class="sptr1">

<td width="51" align="center" height="21" style="word-break:break-all"> 524348</td>
<td width="87" align="center" style="word-break:break-all">你说(抢先听)</td>
<td width="46" align="center"> 正常</td>
<td width="46" align="center"> <img src="image_zh/huobi.gif">2.00</td>


<td width="46" align="center"> --</td>



<td width="66" align="center"> 2008-10-09</td>


<td width="41" align="center"> 13</td>


<td width="30" align="center"><a href="javascript:splisten('WEB','http://211.137.79.172:8080/colorring/al/617/524/0/0000/0000/348.wav','524348','xOPLtaOox8DPyMz9o6k=')"><img src="image/lingsheng.gif" width="18" height="17" border="0"></a></td>
<td width="31" align="center"><a href="javascript:splisten('AIP','http://211.137.79.172:8080/colorring/rl/617/524/0/0000/0000/348.wav','524348','xOPLtaOox8DPyMz9o6k=')"><img src="image/lingyinshiting.gif" width="18" height="17" border="0"></a></td>
<td width="31" align="center"><a href="javascript:submitform('spqueryselftoneinfo.screen?index=0')"><img src="image/forbutton/xiugaiicon.gif" width="12" height="14" border="0"></a></td>
<td width="41" align="center"><a href="javascript:seturltext('deletetone.screen?info=0')"><img src="image/forbutton/shanchuicon.gif" width="12" height="14" border="0"></a></td>
<td align="center" valign="middle">
<a href="hideorresumetone.do?resourceID=94683&operateType=1&resourceType=1"><img src="image/forbutton/yincang.gif" width="12" height="14" border="0" title="隐藏铃音"></a>

  

</td>

<td width="31" align="center">

<a href="javascript:submitform('uploadshocktone.screen?index=0')"><img src="image_zh/xiazai.gif" width="18" height="17" border="0"></a>

</td>


</tr>


匹配一:
<td[^>]*>(?: |\s|<img\b[^>]*>)*(?=((?:(?!<\/td>)[\s\S])+))\1<\/td>

结果一:
Found 13 match(es):

start=50, end=138
Group(0) = <td width="51" align="center" height="21" style="word-break:break-all"> 524348</td>
Group(1) = 524348

start=151, end=222
Group(0) = <td width="87" align="center" style="word-break:break-all">你说(抢先听)</td>
Group(1) = 你说(抢先听)

start=235, end=278
Group(0) = <td width="46" align="center"> 正常</td>
Group(1) = 正常

start=291, end=366
Group(0) = <td width="46" align="center"> <img src="image_zh/huobi.gif">2.00</td>
Group(1) = 2.00

start=372, end=415
Group(0) = <td width="46" align="center"> --</td>
Group(1) = --

start=435, end=486
Group(0) = <td width="66" align="center"> 2008-10-09</td>
Group(1) = 2008-10-09

start=501, end=544
Group(0) = <td width="41" align="center"> 13</td>
Group(1) = 13

start=564, end=807
Group(0) = <td width="30" align="center"><a href="javascript:splisten('WEB','http://211.137.79.172:8080/colorring/al/617/524/0/0000/0000/348.wav','524348','xOPLtaOox8DPyMz9o6k=')"><img src="image/lingsheng.gif" width="18" height="17" border="0"></a></td>
Group(1) = <a href="javascript:splisten('WEB','http://211.137.79.172:8080/colorring/al/617/524/0/0000/0000/348.wav','524348','xOPLtaOox8DPyMz9o6k=')"><img src="image/lingsheng.gif" width="18" height="17" border="0"></a>

start=820, end=1068
Group(0) = <td width="31" align="center"><a href="javascript:splisten('AIP','http://211.137.79.172:8080/colorring/rl/617/524/0/0000/0000/348.wav','524348','xOPLtaOox8DPyMz9o6k=')"><img src="image/lingyinshiting.gif" width="18" height="17" border="0"></a></td>
Group(1) = <a href="javascript:splisten('AIP','http://211.137.79.172:8080/colorring/rl/617/524/0/0000/0000/348.wav','524348','xOPLtaOox8DPyMz9o6k=')"><img src="image/lingyinshiting.gif" width="18" height="17" border="0"></a>

start=1081, end=1266
Group(0) = <td width="31" align="center"><a href="javascript:submitform('spqueryselftoneinfo.screen?index=0')"><img src="image/forbutton/xiugaiicon.gif" width="12" height="14" border="0"></a></td>
Group(1) = <a href="javascript:submitform('spqueryselftoneinfo.screen?index=0')"><img src="image/forbutton/xiugaiicon.gif" width="12" height="14" border="0"></a>

start=1279, end=1455
Group(0) = <td width="41" align="center"><a href="javascript:seturltext('deletetone.screen?info=0')"><img src="image/forbutton/shanchuicon.gif" width="12" height="14" border="0"></a></td>
Group(1) = <a href="javascript:seturltext('deletetone.screen?info=0')"><img src="image/forbutton/shanchuicon.gif" width="12" height="14" border="0"></a>

start=1468, end=1711
Group(0) = <td align="center" valign="middle">
<a href="hideorresumetone.do?resourceID=94683&operateType=1&resourceType=1"><img src="image/forbutton/yincang.gif" width="12" height="14" border="0" title="隐藏铃音"></a>

  

</td>
Group(1) = <a href="hideorresumetone.do?resourceID=94683&operateType=1&resourceType=1"><img src="image/forbutton/yincang.gif" width="12" height="14" border="0" title="隐藏铃音"></a>

  



start=1728, end=1914
Group(0) = <td width="31" align="center">

<a href="javascript:submitform('uploadshocktone.screen?index=0')"><img src="image_zh/xiazai.gif" width="18" height="17" border="0"></a>

</td>
Group(1) = <a href="javascript:submitform('uploadshocktone.screen?index=0')"><img src="image_zh/xiazai.gif" width="18" height="17" border="0"></a>





匹配二:
<td[^>]*>(?: |\s|<img\b[^>]*>)*([\s\S]+?)<\/td>

结果二:
Found 13 match(es):

start=50, end=138
Group(0) = <td width="51" align="center" height="21" style="word-break:break-all"> 524348</td>
Group(1) = 524348

start=151, end=222
Group(0) = <td width="87" align="center" style="word-break:break-all">你说(抢先听)</td>
Group(1) = 你说(抢先听)

start=235, end=278
Group(0) = <td width="46" align="center"> 正常</td>
Group(1) = 正常

start=291, end=366
Group(0) = <td width="46" align="center"> <img src="image_zh/huobi.gif">2.00</td>
Group(1) = 2.00

start=372, end=415
Group(0) = <td width="46" align="center"> --</td>
Group(1) = --

start=435, end=486
Group(0) = <td width="66" align="center"> 2008-10-09</td>
Group(1) = 2008-10-09

start=501, end=544
Group(0) = <td width="41" align="center"> 13</td>
Group(1) = 13

start=564, end=807
Group(0) = <td width="30" align="center"><a href="javascript:splisten('WEB','http://211.137.79.172:8080/colorring/al/617/524/0/0000/0000/348.wav','524348','xOPLtaOox8DPyMz9o6k=')"><img src="image/lingsheng.gif" width="18" height="17" border="0"></a></td>
Group(1) = <a href="javascript:splisten('WEB','http://211.137.79.172:8080/colorring/al/617/524/0/0000/0000/348.wav','524348','xOPLtaOox8DPyMz9o6k=')"><img src="image/lingsheng.gif" width="18" height="17" border="0"></a>

start=820, end=1068
Group(0) = <td width="31" align="center"><a href="javascript:splisten('AIP','http://211.137.79.172:8080/colorring/rl/617/524/0/0000/0000/348.wav','524348','xOPLtaOox8DPyMz9o6k=')"><img src="image/lingyinshiting.gif" width="18" height="17" border="0"></a></td>
Group(1) = <a href="javascript:splisten('AIP','http://211.137.79.172:8080/colorring/rl/617/524/0/0000/0000/348.wav','524348','xOPLtaOox8DPyMz9o6k=')"><img src="image/lingyinshiting.gif" width="18" height="17" border="0"></a>

start=1081, end=1266
Group(0) = <td width="31" align="center"><a href="javascript:submitform('spqueryselftoneinfo.screen?index=0')"><img src="image/forbutton/xiugaiicon.gif" width="12" height="14" border="0"></a></td>
Group(1) = <a href="javascript:submitform('spqueryselftoneinfo.screen?index=0')"><img src="image/forbutton/xiugaiicon.gif" width="12" height="14" border="0"></a>

start=1279, end=1455
Group(0) = <td width="41" align="center"><a href="javascript:seturltext('deletetone.screen?info=0')"><img src="image/forbutton/shanchuicon.gif" width="12" height="14" border="0"></a></td>
Group(1) = <a href="javascript:seturltext('deletetone.screen?info=0')"><img src="image/forbutton/shanchuicon.gif" width="12" height="14" border="0"></a>

start=1468, end=1711
Group(0) = <td align="center" valign="middle">
<a href="hideorresumetone.do?resourceID=94683&operateType=1&resourceType=1"><img src="image/forbutton/yincang.gif" width="12" height="14" border="0" title="隐藏铃音"></a>

  

</td>
Group(1) = <a href="hideorresumetone.do?resourceID=94683&operateType=1&resourceType=1"><img src="image/forbutton/yincang.gif" width="12" height="14" border="0" title="隐藏铃音"></a>

  



start=1728, end=1914
Group(0) = <td width="31" align="center">

<a href="javascript:submitform('uploadshocktone.screen?index=0')"><img src="image_zh/xiazai.gif" width="18" height="17" border="0"></a>

</td>
Group(1) = <a href="javascript:submitform('uploadshocktone.screen?index=0')"><img src="image_zh/xiazai.gif" width="18" height="17" border="0"></a>



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值