| Author |
greedy quantifier
|
Isaac Lee
Greenhorn
Joined: Feb 25, 2005
Posts: 2
|
|
I have the following program :
I get the result like this:
0f
1
For the program below:
I get the result :
0f
I don't understand why the results are different. In my understanding, the first program should give the result 0f , the same as the second. why is it different?
Thanks.
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14672
|
|
|
Please check your private messages for an important administrative matter.
|
[My Blog]
All roads lead to JavaRanch
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16695
|
|
In the first case, the pattern is zero or one letter f. In the second case, the pattern is one or more letter f. It is the zero letter f part of the first pattern that allows the second match.
Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
Isaac Lee
Greenhorn
Joined: Feb 25, 2005
Posts: 2
|
|
Thank you. Henry
|
 |
Rahul P Kumar
Ranch Hand
Joined: Sep 26, 2009
Posts: 188
|
|
|
[Deleted entire post as "hi-jack." Original in our "deleted" forum. CR]
|
 |
 |
|
|
subject: greedy quantifier
|
|
|