diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2020-11-25 00:24:56 +0100 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2020-11-25 00:24:56 +0100 |
commit | 17582f0b1d5e6a33ec353f3ff63f37f0a2764c0c (patch) | |
tree | 36142cdc285d253d361fa13733b94b052d9f03b3 | |
parent | 4fbe256109b77f2375843a0756e603d9920a58b2 (diff) | |
download | fuzzycat-17582f0b1d5e6a33ec353f3ff63f37f0a2764c0c.tar.gz fuzzycat-17582f0b1d5e6a33ec353f3ff63f37f0a2764c0c.zip |
fix regex
-rw-r--r-- | fuzzycat/verify.py | 4 |
1 files 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+', '<NUM>', s) + return re.sub(r'\d+', '<NUM>', s) def contains_chemical_formula(s): |