Re: [pcre-dev] Quantified assertions inside lookbehind asser…

Top Page
Delete this message
Author: ph10
Date:  
To: ND
CC: Pcre-dev
Subject: Re: [pcre-dev] Quantified assertions inside lookbehind assertion cause error
On Sun, 1 Jul 2018, ND via Pcre-dev wrote:

> PCRE2 version 10.31 2018-02-12
> /(?<=(?=.)?)/
> Failed: error 125 at offset 0: lookbehind assertion is not fixed length
> ab
>
> Assertion have a fixed 0 length not matter it quantified or not.
> So such patterns shouldn't rise error.


Indeed. You have found a bug. It was ignoring the lookahead, but not the
qualifier. I have fixed it. Thank you for the report.

> It seems it's no error in Perl.


I don't know why Perl allows qualifiers on assertions, because they
don't mean anything. PCRE used to give an error, but I changed it to
allow them, in order to be compatible.

Philip

--
Philip Hazel