ARTS-S python把非汉语和非字母的字符替换成空格

# coding: utf-8
import re
text = "aa[bb,aa#cWc中a国"
FILTER_PUNTS = re.compile("[^\u4E00-\u9FA5|^a-z|^A-Z]")
text = FILTER_PUNTS.sub(" ", text.strip())
print(text)

posted on 2019-07-11 21:44  荷楠仁  阅读(1072)  评论(0编辑  收藏  举报

导航