[pcre-dev] [Bug 2771] New: (*MARK) not returned from group w…

Top Page

Reply to this message
Author: admin
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 2771] New: (*MARK) not returned from group with possessive repetition
https://bugs.exim.org/show_bug.cgi?id=2771

            Bug ID: 2771
           Summary: (*MARK) not returned from group with possessive
                    repetition
           Product: PCRE
           Version: 8.44
          Hardware: x86-64
                OS: Windows
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
          Assignee: Philip.Hazel@???
          Reporter: unravelin@???
                CC: pcre-dev@???


When (*MARK:NAME) is used inside a group which has a possessive quantifier with
no upper bound, the mark is not returned. For example, with pcretest:

re> /(?:A(*:X))*+/K
data> A

0: A

By contrast, the mark is returned after removing + or adding an upper bound:

re> /(?:A(*:X))*/K
data> A

0: A
MK: X

re> /(A(*:X)){1,999}+/K
data> A

0: A
1: A
MK: X

If a previous mark was set it is returned instead:

re> /(*:Y)(A(*:X))*+/K
data> A

0: A
1: A
MK: Y

>From what I can tell this occurs because OP_MARK receives a return code of

MATCH_KETRPOS but sets mark only when it receives MATCH_MATCH or MATCH_ACCEPT.
Adding a check for MATCH_KETRPOS appears to solve the problem, but I'm not sure
this is correct for all cases.

--
You are receiving this mail because:
You are on the CC list for the bug.