From 1bdda3ad318f75a7f9594555119e2927bcbd3bb9 Mon Sep 17 00:00:00 2001 From: Isaac Riley Date: Sun, 17 May 2020 20:47:38 +0200 Subject: [PATCH] simplified reference and sequence regexes --- utils/constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/constants.py b/utils/constants.py index 7f983f9..40327e2 100644 --- a/utils/constants.py +++ b/utils/constants.py @@ -13,10 +13,10 @@ REGEX_CONSTANTS = { 'CONTAINS_YEAR': re.compile(r"(?<=[^0-9])1[8-9][0-9]{2}(?=[^0-9$])|(?<=[^0-9])20[0-2][0-9](?=[^0-9$])"), # Regex for matching Number Sequences in the text -> (15) / (10, 11, 112, 113) / (1,7,8,10-14) - 'SEQUENCE': re.compile(r"\([\d\-,\s]+\)"), + 'SEQUENCE': re.compile(r"\([\d.*\)"), # Regex for matching References in the text -> [4] / [ 10-17, 19, 20] / [123, 500] - 'REFERENCE': re.compile(r"\[[\d\-,\s]+\]"), + 'REFERENCE': re.compile(r"\[\d.*\]"), # Regex for matching percentages in the text -> 99% / 99.99% / 10 % / 23.98% / 10-20% / 25%-30% 'PERCENTAGE': re.compile(r"\d[\d\.\-]+%"),