Python 中文字符串正则表达式

import re

s='='金''

#只保留金这个字

s=re.sub(r'\W','',s)

#去掉金字

s=re.sub(r'\w','',s)

猜你喜欢

转载自www.cnblogs.com/thechain/p/9401975.html
今日推荐