def unescapematch(matchobj):
    escapesequence = matchobj.group(0)
digits = escapesequence[2:]
ordinal = int(escapesequence, 16)
char = chr(ordinal)
return char
re.sub('(\\\\u[0-9A-Fa-f]+)', unescapematch, t)
Easiest way to remove unicode representations from a string in python 3?