Repository navigation
Closed
Labels
Description
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-syntax seems to be from Unicode 16: 9239e7e
The disagreement causes divergent behavior, for example between EDIT: bad example, see #1387 (comment) instead.char methods and regex character classes:
Bad Example
[package]
name = "repro"
version = "0.1.0"
edition = "2024"
[dependencies]
regex = "1.13.1"use regex::Regex;
fn main() {
dbg!(char::UNICODE_VERSION);
let c = '\u{323B0}';
dbg!(c.is_alphabetic());
dbg!(Regex::new(r"[[:alpha:]]").unwrap().is_match(&c.to_string()));
}$ 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()) = falseTwo separate thoughts:
- Can we bump to Unicode 17?
- Could we expose a
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-L75
Thanks!
Activity
ajvondrak commentedon Aug 11, 2026
Woops, just realized my example uses
[[:alpha:]], which is specifically the ASCII alphabetic range. That was just my attempt to simplify the repro from the actual issue I encountered, where\p{XID_Start}wasn't aligning withunicode_ident::is_xid_start(which uses Unicode 17). Same basic idea though:feat: update to Unicode 18 (#1387)
feat: update to Unicode 18 (#1387)
feat: update to Unicode 18 (rust-lang#1387)