import java.util.regex.*;
class Regex2
{
public static void main(
String[] args)
{
Pattern p = Pattern.compile(args[0]); // "\d*"
Matcher m = p.matcher(args[1]); //ab34ef
boolean b = false;
while(b = m.find())
{
System.out.print(m.start() + m.group());
}
}
}
Run this above prgam with
java Regex2 "\d*" ab34ef Can any one explain this above program please...Preparing for
SCJP 5.0..
Thanks in advance..
Ishmayel.
[ November 27, 2007: Message edited by: ishmayel vemuru ]