aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Regular Expression" Watch "Regular Expression" New topic
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regular Expression