Closed tducret closed 2 years ago
Since Python 3.6, the re module has been rejecting unknown escape sequences such as \q
in patterns and escape sequences including \d
in replacement templates.
As the regex module no longer supports versions of Python <3.6, I've brought the regex module into line with re.
You code should now read:
pattern = DIGIT_GROUP_PATTERN.sub(r'?P<n>\\d+', pattern)
Thanks for the prompt answer @mrabarnett.
I'll create an issue in the dateparser
project then (since this code is actually > https://github.com/scrapinghub/dateparser/blob/master/dateparser/languages/locale.py#L172)
Incidentally, the code appears to be merely searching for a literal string and replacing with a literal string, so regex would be overkill anyway; using str.replace
would be better.
Hi there 👋 First, thank you very much for this great library! I'm having the following exception while using
regex
along with thedateparser
library:Context:
regex
== 2022.3.15 _(regex-2022.3.15-cp310-cp310-macosx_11_0arm64.whl)dateparser
== 1.1.0To reproduce:
When downgrading to version
2022.3.2
, everything works fine though.Can you please have a look?