Ezio Melotti added the comment:
You either have to double escape it (once for python and then for the regex
engine) or use raw strings:
>>> re.match("", '\\').group()
'\\'
>>> re.match(r"\\", '\\').group()
'\\'
--
assignee: -> ezio.melotti
resolution: -> invalid
stage: -> commit
New submission from Michał Leśniewski :
If a regular expression ends with a backslash, an exception is raised. Of
course, the backslash has to be escaped. The simplest example, that causes the
error is a regular expression, that should match only a single backslash:
import re
r = re.co