From: Jakob Cornell Date: Sat, 30 Sep 2023 20:32:11 +0000 (-0500) Subject: Refactor number parsing regex X-Git-Url: https://jcornell.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=cc18eeffdf61e2a99c99013e86d67995115c3815;p=counting.git Refactor number parsing regex fancy_regex doesn't support disabling Unicode, so switch to explicitly matching ASCII digits. --- 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())