81,092
社区成员
发帖
与我相关
我的任务
分享
public class Test {
public static void main(String args[]) throws Exception{
String html = "<tr><td>aa</td></tr><tr><td>bb</td></tr><tr><td>cc</td></tr>";
Matcher m = Pattern.compile("<tr>.+?</tr>").matcher(html);
int c = 1;
while(m.find()){
if(c++ == 3){
System.out.println(m.group(0));
}
}
}
}