This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Greedy quantifiers(*) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Greedy quantifiers(*)" Watch "Greedy quantifiers(*)" New topic
Author

Greedy quantifiers(*)

K Raj Kumar
Greenhorn

Joined: Sep 16, 2008
Posts: 17
Hi Ranchers!


java Regex2 "\d*" ab34ef

Output:01234456

I am unable to interpret the last part of the output esp at"456".
So,please help me in understanding it.

Source:SCJP 6 study java guide, Kathy sierra and Bert bates, Self Test,Page 515.

Thanks in advance!


With Regards,<br />K.Raj Kumar.
Punit Singh
Ranch Hand

Joined: Oct 16, 2008
Posts: 952


Run this and try to understand it is very simple.


SCJP 6
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

This question is answered comprehensively in FAQ. The link is in my signature...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Greedy quantifiers(*)
 
Similar Threads
Regex Question from K&B
confused about Scanner class
regex
doubt regarding patterns in regex
Regex Program