def _escapefun(matchobj):
    """Callback to interpret an escape sequence"""
    s = matchobj.group()
    c = s[1]
    i = "bfnrt".find(c)
    if i >= 0:
        c = "\b\f\n\r\t"[i]
    elif c == 'x':
        c = chr(int(s[2:], 16))
    elif c in '01234567':
        c = chr(int(s[1:], 8))
    return c