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)
# 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)