Re: [pcre-dev] Remove some restrictions of lookbehind assert…

Top Page
Delete this message
Author: ND
Date:  
To: Pcre-dev
Subject: Re: [pcre-dev] Remove some restrictions of lookbehind assertions
On 2019-08-08 16:59, ph10 wrote:
> On Sat, 3 Aug 2019, ND via Pcre-dev wrote:
>> May be it can be useful to have ability to set a limits of lookbehind
> search
> > for performance reasons.
> > I can imagine a rule: If nonfixedlength lookbehind immediately
> preceded by
> > capture group, then it is restricted to start position of this group.
>Non-fixed-length lookbehinds are almost certainly never going to be
> implemented with the current PCRE2 design. It was originally inventedfor
> Perl-4 patterns and is very much left-to-right oriented. Note thatwhen
> Perl-5 invented lookarounds, they also restricted lookbehinds tofixed
> length, and I presume Perl implements them in the same way: moveback a
> fixed number of characters, then run the lookbehind forwards.
>


Nonfixedlength lookbehinds are implemented in some regex engines. And at
least one of them (alternative Python regex engine) successfully implement
it in left-to-right manner.

I'm sorry. But all previous posts in this topic are a suggestions how
actually nonfixedlength lookbehinds can be implemented in CURRENT PCRE
design.
What can you say about this suggestions?