Repository navigation
Bump go-regexp/engine: full-Unicode POSIX character classes (+37) - #514
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.0over 22 representative code points):[[:alpha:]]matches"à",[[:digit:]]matches"٠",[[:alnum:]]/[[:upper:]]/[[:lower:]]/[[:space:]]/[[:word:]]widen to Unicode (incl. theOther_Uppercase/NlRoman 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);/n) patterns keep the byte-oriented behaviour.Conformance:
language/regexp/character_classes_spec83 → 120 (+37).go test ./...green, native +wasip1/wasmbuild. FLOOR left untouched (bumped in the consolidating change with the other parallel PRs).🤖 Generated with Claude Code