From cc18eeffdf61e2a99c99013e86d67995115c3815 Mon Sep 17 00:00:00 2001 From: Jakob Cornell Date: Sat, 30 Sep 2023 15:32:11 -0500 Subject: [PATCH] Refactor number parsing regex fancy_regex doesn't support disabling Unicode, so switch to explicitly matching ASCII digits. --- sharedmodel/src/update_parse.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharedmodel/src/update_parse.rs b/sharedmodel/src/update_parse.rs index 9c0c8eb..758a5af 100644 --- a/sharedmodel/src/update_parse.rs +++ b/sharedmodel/src/update_parse.rs @@ -152,7 +152,7 @@ fn parse_from_lines(lines: &[impl Borrow], curr_count: Option, bot_u // look for groups of ASCII digits (as many as possible) separated by a uniform separator // from the valid set let pattern = fancy_regex::Regex::new( - "(?-u)^(?Pv)?(?P-)?(?P\\d+((?P[,. \u{2009}]|, )\\d+((?P=sep)\\d+)*)?)" + "^(?Pv)?(?P-)?(?P[0-9]+((?P[,. \u{2009}]|, )[0-9]+((?P=sep)[0-9]+)*)?)" ).unwrap(); let match_result = pattern .captures(lines[0].borrow()) -- 2.30.2