Skip to content

compile string constraint patterns with the u flag - #49

Merged
ahl merged 1 commit into
mainfrom
regex-unicode-flag
Nov 13, 2026
Merged

ahl merged 1 commit into
mainfrom
regex-unicode-flag

Conversation

@ahl

@ahl ahl commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

JSON Schema patterns carry ECMA-262 unicode semantics, and the JSON Schema test suite expects them on every draft; without the flag a unicode property escape does not match and an escape like \p{L} can accept strings the pattern rejects. The emitted LazyLock now builds the regex with Regex::with_flags(p, "u"), as typify does on main (#1103). A pattern with an identity escape the u flag forbids fails in the consumer's build, where it failed to match before; typespace does not compile patterns at build time, since regress is only a dev dependency.

See oxidecomputer/typify#1103

JSON Schema patterns carry ECMA-262 unicode semantics, and the JSON
Schema test suite expects them on every draft; without the flag a
unicode property escape does not match and an escape like \p{L} can
accept strings the pattern rejects. The emitted LazyLock now builds the
regex with Regex::with_flags(p, "u"), as typify does on main (#1103).
A pattern with an identity escape the u flag forbids fails in the
consumer's build, where it failed to match before; typespace does not
compile patterns at build time, since regress is only a dev dependency.
@ahl
ahl merged commit 5ee25cc into main Nov 13, 2026
10 checks passed
@ahl
ahl deleted the regex-unicode-flag branch November 13, 2026 16:30
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