日期:2014-05-20  浏览次数:20666 次

正则式有没有循环匹配

<li> word </li>

<li> word <a   title= "xxx "   href= "/xxx.html "   rel= "section "> word </a> </li>

<li> word </li>

<li> word </li>
</ul>

<p> word </p>

<h2> word </h2>

<br   />
<table   summary= "xxx ">
<tbody>
<tr>
<td> </td>
<td> <strong> word </strong> </td>
<td> </td>
</tr>

<tr>
<td> </td>
<td> <strong> word </strong> </td>
<td> word </td>
</tr>

<tr>
<td> </td>
<td> <strong> word </strong> </td>
<td> word </td>
</tr>

<tr>
<td> </td>
<td> <strong> word </strong>   </td>
<td> word </td>
</tr>

<tr>
<td> </td>
<td> <strong> word </strong>   </td>
<td> word </td>
</tr>

<tr>
<td> </td>
<td> <strong> word </strong> </td>
<td> word </td>
</tr>

<tr>
<td> </td>
<td> <strong> word </strong>   </td>
<td> word </td>
</tr>

<tr>
<td> </td>
<td> <strong> word </strong>   </td>
<td> word </td>
</tr>

<tr>
<td> </td>
<td> <strong> word </strong> </td>
<td> word </td>
</tr>

<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>

<tr>
<td> </td>
<td> <strong> word </strong> </td>
<td> </td>
</tr>

想用regular   expression取出word内容,但看文章说R   E只能匹配最近一个符合的,有办法用一种R   E表达方法把所有结构类似的内容取出来吗????

------解决方案--------------------
谁说的? 符合的都能匹配出来 正则表达式
------解决方案--------------------
哪几个字母是Key
------解决方案--------------------
:)

.*
------解决方案--------------------
"\\s+\\ <\\s+a\\s+title=\\ "?.+\\ "?\\s+href=\\ "?.+\\ "?\\s+rel=\\ "?.+\\ "?\\s+\\> \\s+ "