|
From: | Egor Ignatov |
Subject: | Probably bug in lib/regexec.c with possessive quantifier |
Date: | Tue, 25 May 2021 11:35:58 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 |
Hi,
So,
after updating gnulib, some test cases in
augeas(https://github.com/hercules-team/augeas) related to
regex started to fail.
I found a commit that introduced this behavior:
70b673eb768eb7288639cbbe4642c2912b7d204e
I simplified the bug case to the following:
re_syntax_options = RE_CONTEXT_INDEP_OPS |
RE_CONTEXT_INVALID_OPS | RE_DOT_NOT_NULL
| RE_INTERVALS |
RE_NO_BK_BRACES | RE_NO_BK_PARENS | RE_NO_BK_REFS
| RE_NO_BK_VBAR |
RE_NO_EMPTY_RANGES | RE_NO_POSIX_BACKTRACKING
| RE_CONTEXT_INVALID_DUP |
RE_NO_GNU_OPS;
pattern = "(.*+)";
text = "EXAMPLE";
And here is what I get in the regs after I run re_match:
match result: 'EXAMPLE'
reg[0]='EXAMPLE'(0,7)
reg[1]='EXAMPLE'(0,-1)
reg[2]=''(-1,-1)
But in the previous versions (before commit specified earlier) I
would get:
match result: 'EXAMPLE'
reg[0]='EXAMPLE'(0,7)
reg[1]='EXAMPLE'(0,7)
reg[2]=''(-1,-1)
As you can see, in the first case reg[1] does not point to the
first group.
However, everything works fine if I remove a possessive quantifier
from the pattern.
Is this intentional behavior or is it a bug?
Thank you
-- Egor
[Prev in Thread] | Current Thread | [Next in Thread] |