| Author |
Regular Expression
|
srilavanyaa subramanian
Greenhorn
Joined: May 30, 2006
Posts: 26
|
|
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()); } } } in comman line give java Regex2 "\d*" ab34ef the output for this is 01234456 ----------- how the flow wrks.. can anyone explain me... what the group function really do here
|
 |
Vinayagar Karpagam
Ranch Hand
Joined: Apr 09, 2006
Posts: 72
|
|
I guess there are already enough discussions on this question. Please have a look at these topics. Topic 1 Topic 2 Topic 3. For other discussions on this same question, try searching the forum with ab34ef.
|
 |
 |
|
|
subject: Regular Expression
|
|
|