Skip to content

[pcre] Escaped-quote pattern group extraction incorrect in DFA_UNROLLED_WITH_GROUPS #33

@jbachorik

Description

@jbachorik

Summary

The pattern "([^\\"]+|\\.)*" fails to extract the correct group value. The tagged DFA tracks groups character-by-character but doesn't handle the case where alternation with + appears inside a * quantifier correctly.

Failing PCRE Test

  • Pattern: "([^\\"]+|\\.)*"
  • Input: "1234\"5678"
  • Expected: group 1 = 5678 (last iteration capture)
  • Actual: wrong group value

Expected gain: +1 PCRE conformance test (Category 9)

Root Cause

DFA_UNROLLED_WITH_GROUPS tracks group capture position per character, not per quantifier iteration. When a * outer quantifier drives an inner alternation containing +, the iteration boundary resets are lost — the final group capture ends up pointing to the wrong position.

Implementation Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions