This is a question from the certification book by Kathy Sierra Chapter 6
import java.util.regex.*
class Regex2{
public static void main (
String[] args){
Pattern p=Pattern.matcher(args[0]);
Matcher m=p.matcher(args[1]);
boolean b=false;
while(b=m.find()){
System.out.println(m.start() + m.group());
}
}
}
And the command line:
java Regex2 "\d*" ab34ef
and the answer is 01234456
I would like to know how that answer was arrived at?