fix regex
All checks were successful
Build and Test / splatie (push) Successful in 9m31s

This commit is contained in:
Maple Nebel 2026-07-01 19:56:34 +02:00
commit 209de180e9
2 changed files with 5 additions and 2 deletions

View file

@ -10,7 +10,7 @@ debug = "none"
debug-assertions = false debug-assertions = false
strip = true strip = true
panic = "abort" panic = "abort"
lto = true # lto = true

View file

@ -56,11 +56,14 @@ impl Default for ErrorInfo {
} }
static ERROR_CODE_REGEX: Lazy<Regex> = static ERROR_CODE_REGEX: Lazy<Regex> =
Lazy::new(|| Regex::new("(?<=(^| ))\\d\\d\\d-\\d\\d\\d\\d(?=($| ))").expect("invalid regex")); Lazy::new(|| Regex::new("\\b\\d\\d\\d-\\d\\d\\d\\d\\b").expect("invalid regex"));
static WORD_BOUNDARY_START: Lazy<Regex> = Lazy::new(|| Regex::new("^\\b").expect("invalid regex"));
static WORD_BOUNDARY_END: Lazy<Regex> = Lazy::new(|| Regex::new("\\b$").expect("invalid regex"));
pub struct ErrorCodeHandler; pub struct ErrorCodeHandler;
fn create_error_explain_message(str_code: &str, expanded: bool) -> Option<EditMessage> { fn create_error_explain_message(str_code: &str, expanded: bool) -> Option<EditMessage> {
let str_code = str_code.trim();
let Ok(category) = str_code[0..3].parse() else { let Ok(category) = str_code[0..3].parse() else {
return None; return None;
}; };