File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Regular Expression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Regular Expression" Watch "Regular Expression" New topic

Regular Expression

srilavanyaa subramanian

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() +;
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.
jQuery in Action, 3rd edition
subject: Regular Expression
It's not a secret anymore!