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

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

Thread Previous
Father Chrysostomos via RT
September 11, 2011 16:34
[perl #92898] (*THEN) broken inside condition subpattern
Message ID:
On Wed Jun 15 11:26:50 2011, 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About