[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl5-porters
Subject:    What should \K inside lookarounds mean [perl #124256]
From:       Aristotle Pagaltzis <pagaltzis () gmx ! de>
Date:       2015-05-27 6:36:02
Message-ID: 20150527063602.GA55223 () plasmasturm ! org
[Download RAW message or body]

* Tony Cook via RT <perlbug-followup@perl.org> [2015-05-27 07:05]:
> What's the intended behaviour of \K in a look-(ahead|behind)?
>
> My first thught was that it should be ignored, something like:
>
> Or should it control the region matched, so \K in the example would
> set $& to "a", as it does now?

It seems to me like it can only really have reasonable semantics at the
"top level" of a match. It's possible to invent more specific semantics
in other places, but everything I can think of is a stretch; they would
just be semantics invented for the sake of existing, not because they do
anything anyone wants.

So I would be most inclined to treat it as a compile error, at the least
inside lookarounds. Preferably also in any group – or maybe just inside
quantified groups.

I have, FWIW, used it plenty but never used it inside a group. Anyone?

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic