Skip to content

regex negative lookbehind ignores a preceding non-ASCII character #5604

Closed

Description

@robertmorelli

issue:
(?<!.)x should match x only when no character precedes it in the input. Racket correctly rejects "ax" but incorrectly matches "éx". The é is outside the matched text, but lookbehind must still inspect it.

repro:

(regexp-match? #px"(?<!.)x" "x")  ; #t
(regexp-match? #px"(?<!.)x" "ax") ; #f
(regexp-match? #px"(?<!.)x" "éx") ; #t (should be #f)

expected:
The third expression should return #f, like the ASCII control: é (U+00E9) is immediately before x.

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

Activity

  1. added a commit that references this issue on Oct 14, 2026
    140b250
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