claude: default fromRegex to fullmatch#9
Merged
Conversation
DRMacIver
added a commit
that referenced
this pull request
Jul 10, 2026
…tion Rebased remnant of "Document fromRegex's unanchored semantics and add a fullmatch overload": main's regex-fullmatch-default change (PR #9) has since made fromRegex generate whole-string matches by default with a fullmatch(boolean) opt-out, superseding the overload and the unanchored documentation. What remains from the original commit: document that patterns use the engine's Python re dialect (which differs from java.util.regex.Pattern in some constructs), and strengthen the previously-vacuous GeneratorSmokeTest assertion (length() >= 0) to pin the fullmatch semantics. Co-Authored-By: Claude Fable 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.
Claude-written description
Flips the default match mode of
Generators.fromRegexfrom "contains a match" to fullmatch (the entire string must match the pattern), matching parallel changes in hegel-rust, hegel-typescript, and hegel-cpp.RegexGeneratornow always emits an explicit"fullmatch"key in its CBOR schema, defaulting totrue. (Previously the key was omitted, silently inheriting the engine's contains-a-match default.)fromRegex(pattern).fullmatch(false), following the library's existing generator-option style;Generators.fromRegexnow returns the concreteRegexGeneratorso the opt-out is chainable (consistent withtext()returningTextGenerator).fullmatchschema key — itssrc/native/schema/regex.rsreads it at that tag — and the new conformance testregexDefaultsToFullmatchexercises both modes against the real engine: the default produces only full matches, and the opt-out demonstrably produces contains-matches with surrounding characters.RELEASE.mdwithRELEASE_TYPE: minor(breaking behavior change; zerover pre-1.0, so breaking changes bump minor).Refs hegeldev/hegel-rust#258