Rename parsers to DATE_REGEX

In moving the `parsers` variable into the package-level, it lost the
context, so a more descriptive name was needed.
This commit is contained in:
Daniel Quinn
2018-09-09 21:02:30 +01:00
parent 69fc0d6d80
commit ef7f98281d
3 changed files with 7 additions and 6 deletions

View File

@@ -13,11 +13,12 @@ from django.conf import settings
# - XX. MONTH ZZZZ with XX being 1 or 2 and ZZZZ being 2 or 4 digits
# - MONTH ZZZZ, with ZZZZ being 4 digits
# - MONTH XX, ZZZZ with XX being 1 or 2 and ZZZZ being 4 digits
pattern = re.compile(
DATE_REGEX = re.compile(
r'\b([0-9]{1,2})[\.\/-]([0-9]{1,2})[\.\/-]([0-9]{4}|[0-9]{2})\b|' +
r'\b([0-9]{1,2}[\. ]+[^ ]{3,9} ([0-9]{4}|[0-9]{2}))\b|' +
r'\b([^\W\d_]{3,9} [0-9]{1,2}, ([0-9]{4}))\b|' +
r'\b([^\W\d_]{3,9} [0-9]{4})\b')
r'\b([^\W\d_]{3,9} [0-9]{4})\b'
)
class ParseError(Exception):