From 17582f0b1d5e6a33ec353f3ff63f37f0a2764c0c Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Wed, 25 Nov 2020 00:24:56 +0100 Subject: fix regex --- fuzzycat/verify.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fuzzycat/verify.py b/fuzzycat/verify.py index 98a1a26..26e7b2a 100644 --- a/fuzzycat/verify.py +++ b/fuzzycat/verify.py @@ -319,7 +319,7 @@ def compare(a, b): if len(a_slug_title) < 10 and a_slug_title != b_slug_title: return (Status.AMBIGUOUS, Miss.SHORT_TITLE) - if re.search(r'\d', a_slug_title) and a_slug_title != b_slug_title and num_project( + if re.search(r'\d+', a_slug_title) and a_slug_title != b_slug_title and num_project( a_slug_title) == num_project(b_slug_title): return (Status.DIFFERENT, Miss.NUM_DIFF) @@ -410,7 +410,7 @@ def num_project(s): Unify every occurence of a digit (or group of digits). """ - return re.sub('\d+', '', s) + return re.sub(r'\d+', '', s) def contains_chemical_formula(s): -- cgit v1.2.3