Skip to content

Support backreferences: \1-\9, \k<name>, \g{...} #19

Description

@halotukozak

Currently rejected at parse time (see RegexParser.scala: if c.isDigit then unsupported(s"backreference \$c`"), and case 'k' => unsupported(...), case 'g' => unsupported(...)`).

Depends on #18 (backreferences need named/numbered groups to exist first).

Also worth noting: backreferences make a regex language non-regular in general, which is a much bigger conceptual change for this library — Brzozowski derivatives and the exact subset-containment guarantee this library is built around (Subset.subset) are defined over regular languages. Supporting backreferences may mean explicitly documenting that subset/containment queries become approximate or unsupported for patterns that use them, rather than extending the same exact-containment guarantee.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions