Skip to content

regex compiling adjacent empty noncapturing regex groups raises an invalid memory reference #5605

Closed

Description

@robertmorelli

issue:
(?:) is a valid empty noncapturing group. Two such groups in sequence should compile and match the empty string, but pregexp raises invalid memory reference while compiling them.

repro:

(pregexp "(?:)(?:)")
; invalid memory reference. Some debugging context lost

expected:
The pattern should compile. (regexp-match? (pregexp "(?:)(?:)") "") should return #t.

system:
Racket v9.3 [cs]
macOS 27.0 (build 26A428), arm64

Activity

  1. added a commit that references this issue on Oct 14, 2026
    efc05a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions