From 6aed6963fa3569a8dd4f167d2c222e3a781b9c1c Mon Sep 17 00:00:00 2001 From: Isaac Riley Date: Sun, 17 May 2020 19:59:12 +0200 Subject: [PATCH] fixed regular expression errors --- utils/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/constants.py b/utils/constants.py index 538fc50..6d8811b 100644 --- a/utils/constants.py +++ b/utils/constants.py @@ -10,7 +10,7 @@ REGEX_CONSTANTS = { 'ACRONYM': re.compile(r"[m0-9\W]([A-Z]{2,})[s0-9\W]"), # Regex for matching Years in the text - > 1995 / 2020 / 2019 - 'CONTAINS_YEAR': re.compile(r"(?<=[^\d])1[8-9]\d\d(?=[^\d])|(?<=[^\d])2[0-1]\d{2}(?=[^\d])"), + '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]+\)"),