hay,
this code gives Runtime Exception called
IllegalStateException.
but if I change expresion "ab" in to "\\d" it compiles fine .
what is the reason can any body explain this ...
my problem is why we don't get same Exception at Second time
import java.util.regex.*;
class Ze{
public static void main(
String s[]){
Pattern a=Pattern.compile("ab");
Matcher m=a.matcher("ababab");
while(m.find()){
m.find();m.find();m.find();
System.out.println(m.start()+m.group());
}
}
}