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

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

Thread Previous
From:
Father Chrysostomos via RT
Date:
September 11, 2011 16:34
Subject:
[perl #92898] (*THEN) broken inside condition subpattern
Message ID:
rt-3.6.HEAD-31297-1315784074-423.92898-15-0@perl.org
On Wed Jun 15 11:26:50 2011, ph10@hermes.cam.ac.uk wrote:
> It seems to me that, if what precedes (*THEN) in a branch matches
> only a fixed string (no backtracking points), then the behaviour
> should be exactly the same as if (*THEN) is not present. Here is
> an example where that is not so:
> 
> Pattern:   /^.*?(?(?=a)a|b(*THEN)c)/
> Subject:   ba
> Result:    no match
> 
> Pattern:   /^.*?(?(?=a)a|bc)/
> Subject:   ba
> Result:    matches "ba"
> 
> I noticed this because I have just fixed the same bug in PCRE.

Do the pipes in the (?(...)...) condition expression count as regular
alternations? It seems they don’t. Should they?


Thread Previous


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