import java.io.*;
import java.util.regex.*;
class Regex
{
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());
}
}
}
command line:
java regex "\d*" ab34ef
output: 01234456
i got this from K&B 5 study guide(self
test question).
i am not getting how the '*'(quantifier) and 'm.group()' works here?
please anyone explain me...
Preparing Scjp5