获取指定字符串的问题!在线等。。。
比如我的字符串为:
<html>
<body>
<table>
<tr>
<td class="sss">
<a href="4.html">444</a>
</td>
<td class="sss">
<a href="5.html">555</a>
</td>
<td class="sss">
<a href="6.html">666</a>
</td>
<td class="sss">
<a href="7.html">777</a>
</td>
</tr>
</table>
</body></html>
Pattern p = Pattern.compile("<td class="sss">.*</td>");
Matcher matcher = p.matcher(str); //str就是上面的那个网页内容
List list = new ArrayList();
while (matcher.find()) {
list.add(matcher.group());
}