Skip to content

Commit

Permalink
Try fixing regex incompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
goodspark committed Aug 11, 2022
1 parent 0ed979e commit 85fb8b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dateparser/languages/locale.py
Expand Up @@ -169,7 +169,7 @@ def _generate_relative_translations(self, normalize=False):
if normalize:
value = list(map(normalize_unicode, value))
pattern = '|'.join(sorted(value, key=len, reverse=True))
pattern = DIGIT_GROUP_PATTERN.sub(r'?P<n>\d+', pattern)
pattern = pattern.replace(r'\d+', r'?P<n>\d+')
pattern = re.compile(r'^(?:{})$'.format(pattern), re.UNICODE | re.IGNORECASE)
relative_dictionary[pattern] = key
return relative_dictionary
Expand Down

0 comments on commit 85fb8b6

Please sign in to comment.