mercurial/utils/stringutil.py
changeset 38477 de275ab362cb
parent 38474 96f65bdf0bf4
child 38576 a3130208db1c
equal deleted inserted replaced
38476:b4cfd803b3f2 38477:de275ab362cb
    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