equal
deleted
inserted
replaced
23 pycompat, |
23 pycompat, |
24 ) |
24 ) |
25 |
25 |
26 # regex special chars pulled from https://bugs.python.org/issue29995 |
26 # regex special chars pulled from https://bugs.python.org/issue29995 |
27 # which was part of Python 3.7. |
27 # which was part of Python 3.7. |
28 _respecial = pycompat.bytestr(b'()[]{}?*+-|^$\\.# \t\n\r\v\f') |
28 _respecial = pycompat.bytestr(b'()[]{}?*+-|^$\\.&~# \t\n\r\v\f') |
29 _regexescapemap = {ord(i): (b'\\' + i).decode('latin1') for i in _respecial} |
29 _regexescapemap = {ord(i): (b'\\' + i).decode('latin1') for i in _respecial} |
30 |
30 |
31 def reescape(pat): |
31 def reescape(pat): |
32 """Drop-in replacement for re.escape.""" |
32 """Drop-in replacement for re.escape.""" |
33 # NOTE: it is intentional that this works on unicodes and not |
33 # NOTE: it is intentional that this works on unicodes and not |