You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During regex compilation, Perl v5.32 appears to be misidentifying a \K that occurs
after a nested set of lookaheads as being inside a lookahead, and therefore incorrectly
terminates compilation with:
\K not permitted in lookahead/lookbehind in regex
This is, for example, causing problems for the Regexp::Debugger module,
which injects small lookaheads into regexes to assist with its reporting of
their matching process.
The reported misbehaviour does not occur in Perl v5.30.0 and earlier
(presumably because they didn't prohibit \K inside lookaheads).
Steps to Reproduce
use v5.32.0;
qr/(?=(?=x)x)\K/;
Expected behavior
This regex should compile correctly. The \K is not inside a lookahead.
During regex compilation, Perl v5.32 appears to be misidentifying a \K that occurs
after a nested set of lookaheads as being inside a lookahead, and therefore incorrectly
terminates compilation with:
\K not permitted in lookahead/lookbehind in regex
This is, for example, causing problems for the Regexp::Debugger module,
which injects small lookaheads into regexes to assist with its reporting of
their matching process.
The reported misbehaviour does not occur in Perl v5.30.0 and earlier
(presumably because they didn't prohibit \K inside lookaheads).
Steps to Reproduce
use v5.32.0;
qr/(?=(?=x)x)\K/;
Expected behavior
This regex should compile correctly. The \K is not inside a lookahead.
Assuming this is a bug, bisection points to the following commit:
105c827d9a0f19a772c7b179e2997d842a095460 is the first bad commit
commit 105c827d9a0f19a772c7b179e2997d842a095460
Author: Tony Cook <[email protected]>
Date: Thu Sep 28 14:40:24 2017 +1000
Commit: Tony Cook <[email protected]>
CommitDate: Mon Aug 19 15:30:46 2019 +1000
(perl #124256) disallow \K in lookahead and lookbehind
\K can cause infinite loops in matching in these, and we're not sure
how it really should behave, so forbid it.
Module:
Description
During regex compilation, Perl v5.32 appears to be misidentifying a
\K
that occursafter a nested set of lookaheads as being inside a lookahead, and therefore incorrectly
terminates compilation with:
This is, for example, causing problems for the Regexp::Debugger module,
which injects small lookaheads into regexes to assist with its reporting of
their matching process.
The reported misbehaviour does not occur in Perl v5.30.0 and earlier
(presumably because they didn't prohibit
\K
inside lookaheads).Steps to Reproduce
Expected behavior
This regex should compile correctly. The
\K
is not inside a lookahead.Perl configuration
The text was updated successfully, but these errors were encountered: