$ cargo run
Compiling repro v0.1.0 (/private/tmp/repro)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.69s
Running `target/debug/repro`
[src/main.rs:4:5] char::UNICODE_VERSION = (
17,
0,
0,
)
[src/main.rs:6:5] c.is_alphabetic() = true
[src/main.rs:7:5] Regex::new(r"[[:alpha:]]").unwrap().is_match(&c.to_string()) = false
Unicode 17.0.0 has been out since 2025 September 9: https://www.unicode.org/versions/Unicode17.0.0/
Rust updated shortly thereafter: rust-lang/rust#146330
But the latest update for
regex-syntaxseems to be from Unicode 16: 9239e7eThe disagreement causes divergent behavior,
for example betweenEDIT: bad example, see #1387 (comment) instead.charmethods andregexcharacter classes:Bad Example
Two separate thoughts:
UNICODE_VERSIONconstant a lachar::UNICODE_VERSION(or as in other crates, likeunicode_ident::UNICODE_VERSION,unicode_normalization::UNICODE_VERSION, etc)? This could make it easier for some users to catch such version drift in the future, similar to this code: https://github.com/rust-lang/rust/blob/a04c7a037d59b6dedc9f921e84e391f13a257aa4/compiler/rustc_parse/src/lib.rs#L39-L75Thanks!