用python匹配一段文字中的所有中文

#正则匹配一段文字中的所有中文
import re
string = 'aaddaweh大大的无ausdy五千股qeas华盛顿哈刚过去而过千万股ads'
result = re.findall(u"[\u4e00-\u9fa5]+",string)
print(result)

# b = re.compile(u"\|[\u4e00-\u9fa5]*\|")
# c = b.findall(string)
# print(c)

猜你喜欢

转载自blog.csdn.net/weixin_42341608/article/details/82657718