67,513
社区成员
发帖
与我相关
我的任务
分享
Pattern p = Pattern.compile("a*b");
Matcher m = p.matcher("aaaaab");
boolean b = m.matches();
Pattern p = Pattern.compile("ab");
Matcher m = p.matcher("wwwabzzz");
String s = "<table id='44'>丰富风范仿佛<table id='33'>hahahaha<table id='22'>100<TABLE id='11'>center</TABLE>11</table>hehehehe</table>444444</table>";
String reg = "(>)?.*?(<TABLE.*?>).*?(</TABLE>).*?(table>)";
Pattern pa = Pattern.compile(reg);
Matcher ma = pa.matcher(s);
boolean r=ma.find();
System.out.println(ma.group());