Mailing List Archive

the variable-length lookbehind experiment
Porters,

variable-length lookbehind: https://github.com/Perl/perl5/issues/18756

This feature was added as an experiment in v5.30.0 and has, as far as I know has been unchanged and has worked as expected. *I propose we mark this feature a success**. *

I am looking for two key opinions here:
* Karl Williamson's
* everybody else's consensus
--
rjbs
Re: the variable-length lookbehind experiment [ In reply to ]
On 6/19/21 7:24 PM, Ricardo Signes wrote:
> Porters,
>
> variable-length lookbehind: https://github.com/Perl/perl5/issues/18756
> <https://github.com/Perl/perl5/issues/18756>
>
> This feature was added as an experiment in v5.30.0 and has, as far as I
> know has been unchanged and has worked as expected. *I propose we mark
> this feature a success**. *
>
> I am looking for two key opinions here:
>
> * Karl Williamson's
> * everybody else's consensus
>

FWIW I am in favor of this
Re: the variable-length lookbehind experiment [ In reply to ]
"Ricardo Signes" <perl.p5p@rjbs.manxome.org> wrote:
>variable-length lookbehind: https://github.com/Perl/perl5/issues/18756
>
>This feature was added as an experiment in v5.30.0 and has, as far as I know has been unchanged and has worked as expected. *I propose we mark this feature a success**. *
>
>I am looking for two key opinions here:
> * Karl Williamson's
> * everybody else's consensus

In the ticket you call it an "experimental feature", but I think "experiment"
is more accurate - there's nothing in feature.pm for it.

I think it is worth asking whether anyone has been using it: I don't recall
any mention here of positive or negative experiences with it. I see that a
handful of simple tests were added in 2abbd513b87 (below, in t/re/re_tests),
but I don't know if more comprehensive tests were added later.

Hugo
---
(?<=af?)b ab y $& b
(?<=a(?:fo)?)b cb n - -
(?<=a(?:foo)?)b b n - -
(?<!c(?:foob)?)b ab y $& b
(?<!c(?:fooba)?)b cb n - -
(?<!c(?:foobar)?)b b y - -
(?<!c(?:foobarb)?)b b y $& b
(?<![cd]e{0,254})b dbcb n - -
(?<![cd]{1,2})[ab] dbaacb y $& a
(?=xy(?<=(aaxyz?))) ..aaxy.. y $1 aaxy
/(?iu)(?<=\xdf)hbase/ sshbase y $& hbase
Re: the variable-length lookbehind experiment [ In reply to ]
On Sun, Jun 20, 2021, at 7:28 AM, hv@crypt.org <mailto:hv%40crypt.org> wrote:
> In the ticket you call it an "experimental feature", but I think "experiment"
> is more accurate - there's nothing in feature.pm for it.

Regular expression are a feature of perl, but are not in feature.pm. perlexperiment.pod calls the listed things "experimental features". I think "feature" is a pretty tough word to circumscribe so tightly when describing a programming language.

> I think it is worth asking whether anyone has been using it: I don't recall
> any mention here of positive or negative experiences with it. I see that a
> handful of simple tests were added in 2abbd513b87 (below, in t/re/re_tests),
> but I don't know if more comprehensive tests were added later.

I agree that it would be good to hear from people using this.

--
rjbs
Re: the variable-length lookbehind experiment [ In reply to ]
On 6/20/21 6:32 AM, Ricardo Signes wrote:
> On Sun, Jun 20, 2021, at 7:28 AM, hv@crypt.org <mailto:hv%40crypt.org>
> wrote:
>> In the ticket you call it an "experimental feature", but I think
>> "experiment"
>> is more accurate - there's nothing in feature.pm for it.
>
> Regular expression are a feature of perl, but are not in feature.pm.
> perlexperiment.pod calls the listed things "experimental features".  I
> think "feature" is a pretty tough word to circumscribe so tightly when
> describing a programming language.
>
>> I think it is worth asking whether anyone has been using it: I don't
>> recall
>> any mention here of positive or negative experiences with it. I see that a
>> handful of simple tests were added in 2abbd513b87 (below, in
>> t/re/re_tests),
>> but I don't know if more comprehensive tests were added later.
>
> I agree that it would be good to hear from people using this.
>
> --
> rjbs

Anybody matching /i with things like the SHARP S and a lookbehind is
automatically using it.
Re: the variable-length lookbehind experiment [ In reply to ]
2021-6-20 10:26 Ricardo Signes <perl.p5p@rjbs.manxome.org>:

> Porters,
>
> variable-length lookbehind: https://github.com/Perl/perl5/issues/18756
>
> This feature was added as an experiment in v5.30.0 and has, as far as I
> know has been unchanged and has worked as expected. *I propose we mark
> this feature a success**. *
>
> I am looking for two key opinions here:
>
> - Karl Williamson's
> - everybody else's consensus
>
> --
> rjbs
>

I was new to this feature, so I searched for it on the web.

brian tried this feature.

https://www.effectiveperlprogramming.com/2020/03/use-a-variable-width-lookbehind-if-it-wont-match-more-than-255-characters/