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 23, 2011 21:37
Subject:
[perl #92898] (*THEN) broken inside condition subpattern
Message ID:
rt-3.6.HEAD-31297-1316839038-285.92898-15-0@perl.org
On Fri Sep 23 02:15:05 2011, ph10@hermes.cam.ac.uk wrote:
> 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.

I wouldn’t say it’s invalid, as Perl’s documentation is a little
unclear.  I hope I have clarified that with commit ac9d848.
> 
> 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.
> 
> Regards,
> Philip




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