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 @ 2019-07-11 21:44 荷楠仁 阅读(1072) 评论(0) 推荐(0) 编辑