Support non capturing regex groups - #76
Merged
Merged
Conversation
…rties
Pharo's Regex engine raises 'Invalid lookaround expression ?:' on (?:...)
non-capturing groups, which are common in real-world schemas (e.g. the
official OAI OpenAPI 3.0 meta-schema's Responses pattern
'^[1-5](?:\d{2}|XX)$') - any document validation that reached such a
pattern crashed outright instead of returning valid/invalid.
Added String>>asECMARegex, which rewrites (?: to ( before compiling.
Semantically equivalent for the boolean match/no-match checks that
pattern and patternProperties need; both call sites now use it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Found while writing broader OpenAPI document-validator test coverage: the OAI meta-schema's component-name patternProperties keys use [a-zA-Z0-9\.\-_]+ (components.schemas/responses/parameters/etc, i.e. almost every object in the spec) - Pharo's Regex engine raised 'bad backslash escape' on the escaped dot inside the class, same root cause as the non-capturing-group issue in the previous commit. \. and . are equivalent inside a character class in every regex dialect, so asECMARegex now also strips the backslash there (tracking class-nesting so it only touches escapes actually inside [...]). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…slash) The three new regex-regression tests embed a JSON string containing a literal backslash (the regex escape char). JSON itself requires that backslash to be escaped as \\ - I'd mirrored these from the working image with single backslashes instead, which is invalid JSON and raised NeoJSONParseError on a fresh load. Verified the corrected literals byte-for-byte via a real JSON parser before committing. Co-Authored-By: Claude Sonnet 5 <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.
No description provided.