如何使用 python 中的 re.sub 通过 unicode 删除字符

how to use re.sub in python to remove a character by it's unicode

例如我想做

new_data = t = re.sub('[ufd3e]'),' ',new_data)

替换字符 uf3ef 但不起作用

你需要使用 \u 来告诉它它是 unicode(你在错误的地方有一个右括号)

new_data = t = re.sub(u'[\ufd3e]',' ',new_data)