the following do well,but it is not the best. Could it be Optimized more?
Pattern p = Pattern.compile("<table([\\s\\S]+?)>([\\s\\S]+?)</table>",Pattern.MULTILINE|Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(sb.toString());
String str="";
while(m.find()){
Pattern pTr = Pattern.compile("<tr.*?>.*?<\\s*/tr.*?>");
Matcher mTr = pTr.matcher(m.group());
Pattern pTd = Pattern.compile("<td.*?>.*?<\\s*/td.*?>");
Matcher mTd = null;
while (mTr.find()) {
mTd = pTd.matcher(mTr.group());
while (mTd.find()) {
str=str+(mTd.group().replaceAll("<.*?>", "").replace(" ", "") + "\t");
}
System.out.println(str );
str="";
}
}