develooper Front page | perl.perl5.porters | Postings from September 2011

[perl #92898] (*THEN) broken inside condition subpattern

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
September 26, 2011 22:22
Subject:
[perl #92898] (*THEN) broken inside condition subpattern
Message ID:
rt-3.6.HEAD-31297-1317100923-1691.92898-15-0@perl.org
On Mon Sep 26 20:04:14 2011, ikegami@adaelis.com wrote:
> On Sat, Sep 24, 2011 at 9:41 AM, Father Chrysostomos via RT <
> perlbug-followup@perl.org> wrote:
> 
> > On Sun Sep 18 13:33:28 2011, sprout wrote:
> > > On Mon Sep 12 06:24:25 2011, ph10@hermes.cam.ac.uk wrote:
> > > > another oddity of (*THEN).
> > > >
> > > > Pattern: /a+?(*THEN)c/
> > > > Subject: aaac
> > > > Result:  Perl 5.012003 matches "aaac"
> > >
> > > That’s strange. In 5.14 it doesn’t match. I don’t know which is worse.
> >
> 
> According to the 5.14.1 docs, it shouldn't match.
> 
> Note that if [the (*PRUNE)] operator is used and NOT inside of an
> alternation then it acts exactly like the (*PRUNE) operator.
> 
> Consider the pattern A (*PRUNE) B, where A and B are complex patterns.
Until
> the (*PRUNE) verb is reached, A may backtrack as necessary to match.
Once it
> is reached, matching continues in B, which may also backtrack as
necessary;
> however, should B not match, then no further backtracking will take place,
> and the pattern will fail outright at the current starting position.

*at the current starting position*

(*THEN) acts like (*COMMIT) in the example given above.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About