in reply to Re: Re: positive integer identification (regular expression question)
in thread positive integer identification (regular expression question)
on the other hand if I were to have ?? then it would try to match 0 or 1 time (in that order where as before (i.e, the single ? )it would try to match it 1 time and failing that it would ignore it was there, making it optional). I understand I might be unclear but I can further clarify if needed. I know this explained in the Mastering Regular Expressions book, but I have not quite yet located it in the Camel book (i will update when/if I find it)
update: As for you question though there is no reason they are capturing parens it could just as well be (?:\.0*)? so they don't have to be capturing parens but I did not figured it mattered in this case, as I am lazy I dont normally put the ?: in the parens to make them non-capturing, unless I care what goes into the $1,$2,... series of variables, that are returned by the capturing parens.
As for it location in in the Camel book (3rd edition) refer to page 142 at the paragraph starting with "Another thing you'll see are what we call quantifiers, ..."
-enlil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^3: positive integer identification (regular expression question)
by CountZero (Bishop) on Feb 08, 2003 at 19:40 UTC |