学习链接https://www.cnblogs.com/shenjianping/p/11647473.html
常用匹配:
- 字符串中去除符号
两种实现方式:
re.split(r'[^\w]', paragraph)
import re,string
text = " Hello, world! 这,是:我;第!一个程序\?()()<>《》 "
punc = '~`!#$%^&*()_+-=|\';":/.,?><~·!@#¥%……&*()——+-=“:’;、。,?》《{}'
print(re.sub(r"[%s]+" %punc, "",text))
3194

被折叠的 条评论
为什么被折叠?



