This question is from chap:6 Self
Test
import java.util.regex.*;
class Regex2
{
public static void main(
String[] args)
{
Pattern p = Pattern.compile(args[0]);
Matcher m = p.matcher(args[1]);
boolean b = false;
while (b = m.find())
{
System.out.print(m.start() + m.group());
}
}
}
And the command line :
java Regex2 "\d*?" ab34ef so output is coming: 0 1 2 3 4 5 6
Please any one explain me how?