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

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

Thread Previous | Thread Next
Philip Hazel
September 23, 2011 02:14
Re: [perl #92898] (*THEN) broken inside condition subpattern
Message ID:
On Wed, 21 Sep 2011, Father Chrysostomos via RT wrote:

> Come to think of it, we already have your version of (*THEN), as
> (?>...). I know I’m just repeating what you said by that. But it has
> just occurred to me that it belongs at the top of this list.
> So your ^A(B(*THEN)C) translates into ^A((?>B)C).

Sure ... but Perl has never shied away from having "more than one way to
do it" has it? :-)  

You will be please to hear that Jeff Friedl, who has only just 
discovered (*THEN) and friends - I guess he's been doing other stuff - 
agrees with your and Perl's interpretation. He even pointed out that
adding a non-matching alternation would change the behaviour. I haven't
had any responses from the mailing list I asked. So on a sample of one
third party, it looks like my intuition is invalid.

At a practical level, I am not sure it is feasible to change PCRE to
behave like Perl, so I may have to settle for documenting the
difference. There are precedents (i.e. other differences).

Thanks for picking this up and having this discussion.


Philip Hazel
Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About