Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
there's a funny regex in the source of TWiki we're trying to use here (and failing - that's why I'm going through the source) where it parses an RCS file:
note the last part:/^([0-9]+)\.([0-9]+)\s+date\s+(\d\d(\d\d)?(\.\d\d){5}?);$/o
I've never seen quantifiers strung together like that... I've checked the Camel Book - it doesn't specifically cover this case, but its talk about "quantified atoms" seems to suggest that the construct is illegal. OTOH since it does compile, so I would be tempted to interpret it as(\.\d\d){5}?;
- but that's not how it matches... :-( It does match((\.\d\d){5})?;
but not a lone.01.02.03.04.05;
I get a feeling there's something wrong with this regex - what do you think?;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex quantifiers composed?
by blakem (Monsignor) on Oct 11, 2002 at 10:14 UTC | |
|
Re: Regex quantifiers composed?
by PodMaster (Abbot) on Oct 11, 2002 at 11:36 UTC | |
|
Re: Regex quantifiers composed?
by Anonymous Monk on Oct 11, 2002 at 10:59 UTC | |
by blakem (Monsignor) on Oct 11, 2002 at 11:11 UTC |