i was hoping someone could help me understand why this happens:
String s = "tbody\n" +"a\n" +"/tbody";
Pattern p = Pattern.compile("tbody[^(/tbody)]+/tbody");
Matcher m = p.matcher(s);
while(m.find()){
System.out.println("found: \n\n"+m.group());
}
Output is:
found:
tbody
a
/tbody
But if String s = "tbody\n" +"ao\n" +"/tbody"
(I added an o after the a) it prints nothing. Can anyone tell me what I am missing?
I'm using NetBeans 7.4.