如果我有一堆跨多行的数据,我如何使它不贪心?我所拥有的是贪婪的。
示例数据
</TD>
<TD CLASS='statusEven'><TABLE BORDER=0 WIDTH='100%' CELLSPACING=0 CELLPADDING=0><TR><TD ALIGN=LEFT><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR>
<TD ALIGN=LEFT valign=center CLASS='statusEven'><A HREF='extinfo.cgi? type=2&host=localhost&service=Current+Load'>Current Load</A></TD></TR>
</TABLE>
</TD>
<TD ALIGN=RIGHT CLASS='statusEven'>
<TABLE BORDER=0 cellspacing=0 cellpadding=0>
<TR>
</TR>
</TABLE>
</TD>
</TR></TABLE></TD>
<TD CLASS='statusOK'>OK</TD>
<TD CLASS='statusEven' nowrap>08-04-2011 22:07:00</TD>
<TD CLASS='statusEven' nowrap>28d 13h 18m 11s</TD>
<TD CLASS='statusEven'>1/1</TD>
<TD CLASS='statusEven' valign='center'>OK - load average: 0.01, 0.04, 0.05 </TD>
到目前为止,这是我的代码
Pattern p = Pattern.compile("(?s)<TD ALIGN=LEFT valign=center CLASS(.*)?<TABLE");
Matcher m = p.matcher(this.resultHTML);
if(m.find())
{
return m.group(1);
}