Skip to content

Bump go-regexp/engine: full-Unicode POSIX character classes (+37) - #514

Merged
tannevaled merged 1 commit into
mainfrom
feat/regexp-posix-unicode
Aug 30, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/regexp-posix-unicode

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

go-regexp/engine v0.1.1 + v0.1.2 make the POSIX bracket classes match the full Unicode set on a UTF-8 pattern, exactly as MRI/Onigmo do (cross-checked byte-for-byte against ruby 4.0 over 22 representative code points):

  • [[:alpha:]] matches "à", [[:digit:]] matches "٠", [[:alnum:]]/[[:upper:]]/[[:lower:]]/[[:space:]]/[[:word:]] widen to Unicode (incl. the Other_Uppercase/Nl Roman numerals);
  • [[:graph:]]/[[:print:]]/[[:punct:]]/[[:blank:]]/[[:cntrl:]] follow their exact Onigmo Unicode definitions;
  • [[:ascii:]] — previously rejected as an "invalid POSIX bracket type" — is added (bytes 0x00–0x7F);
  • ASCII-8BIT (/n) patterns keep the byte-oriented behaviour.

Conformance: language/regexp/character_classes_spec 83 → 120 (+37). go test ./... green, native + wasip1/wasm build. FLOOR left untouched (bumped in the consolidating change with the other parallel PRs).

🤖 Generated with Claude Code

go-regexp/engine v0.1.2 makes the POSIX bracket classes match the full
Unicode set on a UTF-8 pattern, exactly as MRI/Onigmo do: [[:alpha:]]
matches "à", [[:digit:]] matches "٠", [[:graph:]]/[[:print:]]/[[:punct:]]/
[[:blank:]]/[[:cntrl:]] follow their Unicode definitions, and [[:ascii:]]
(previously an "invalid POSIX bracket type") is added as bytes 0x00-0x7F.

Lifts language/regexp/character_classes_spec from 83 to 120 passing
examples, cross-checked byte-for-byte against MRI Ruby 4.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 47065e1 into main Aug 30, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/regexp-posix-unicode branch August 30, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant