I am getting a SyntaxError when debugging some code. The error is related to an invalid use with \ in the context of string matching (see link for exact line below).
re.finditer('{0}\s*'.format(re.escape(sent)), self.original_text)
Which raises the following error:
E File "local\.venv\Lib\site-packages\pysbd\segmenter.py", line 66
E for match in re.finditer('{0}\s*'.format(re.escape(sent)), self.original_text):
E ^^^^^^^^
E SyntaxError: invalid escape sequence '\s'
|
for match in re.finditer('{0}\s*'.format(re.escape(sent)), self.original_text): |