Skip to content

claude: default fromRegex to fullmatch#9

Merged
Liam-DeVoe merged 4 commits into
mainfrom
regex-fullmatch-default
Jul 9, 2026
Merged

claude: default fromRegex to fullmatch#9
Liam-DeVoe merged 4 commits into
mainfrom
regex-fullmatch-default

Conversation

@Liam-DeVoe

@Liam-DeVoe Liam-DeVoe commented Jul 9, 2026

Copy link
Copy Markdown
Member
Claude-written description

Flips the default match mode of Generators.fromRegex from "contains a match" to fullmatch (the entire string must match the pattern), matching parallel changes in hegel-rust, hegel-typescript, and hegel-cpp.

  • RegexGenerator now always emits an explicit "fullmatch" key in its CBOR schema, defaulting to true. (Previously the key was omitted, silently inheriting the engine's contains-a-match default.)
  • Opt out via the fluent copy method fromRegex(pattern).fullmatch(false), following the library's existing generator-option style; Generators.fromRegex now returns the concrete RegexGenerator so the opt-out is chainable (consistent with text() returning TextGenerator).
  • Verified the pinned engine (libhegel 0.14.14) honors the fullmatch schema key — its src/native/schema/regex.rs reads it at that tag — and the new conformance test regexDefaultsToFullmatch exercises both modes against the real engine: the default produces only full matches, and the opt-out demonstrably produces contains-matches with surrounding characters.
  • RELEASE.md with RELEASE_TYPE: minor (breaking behavior change; zerover pre-1.0, so breaking changes bump minor).

Refs hegeldev/hegel-rust#258

@Liam-DeVoe Liam-DeVoe merged commit 49fda8e into main Jul 9, 2026
7 checks passed
@Liam-DeVoe Liam-DeVoe deleted the regex-fullmatch-default branch July 9, 2026 22:09
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>
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