From ecd12327136739c391da1462b8a665ce181ae104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 22 Jun 2019 15:40:34 +0200 Subject: [PATCH] even better regex for time parsing --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ffa1f31..7c87c49 100644 --- a/src/main.rs +++ b/src/main.rs @@ -501,7 +501,7 @@ impl TryFrom<&str> for SubDuration { fn try_from(value: &str) -> Result { lazy_static! { - static ref TIME_RE: Regex = Regex::new(r"^(?P-)?(?:(?:(?P\d+):)?(?P\d+):)?(?P\d+(?:[.,]\d+)?)$").unwrap(); + static ref TIME_RE: Regex = Regex::new(r"^(?U)(?P-)?(?:(?P\d+):)?(?:(?P\d+):)?(?P\d+(?:[.,]\d+)?)$").unwrap(); } match TIME_RE.captures(value) {