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

Reply via email to