| Author |
Regex Program
|
Srinivas Katta
Ranch Hand
Joined: Feb 01, 2007
Posts: 74
|
|
Hi,
I have executed the below Program from K&B
And the command line:
java Regex2 "\d*" ab34ef
My assumption is that the output would be 0123445 but the actual output displayed is 01234456. I do not understand how?
Thanks
Srinivas
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14672
|
|
|
Check this FAQ.
|
[My Blog]
All roads lead to JavaRanch
|
 |
Sahil Kapoor
Ranch Hand
Joined: Sep 12, 2009
Posts: 316
|
|
\d* eseentially implies zero or more numeric digits.
Zero length match can occur in several places and one out of it is
After the last character of source data. in your example 6 !!!
See pg 500 in K&B !!!
|
SCJP 6.0 96%
(Connecting the Dots ....)
|
 |
 |
|
|
subject: Regex Program
|
|
|