正则表达式匹配字符串中的汉字

import re

str1='<h1>2022你好呀</h1>'
print(''.join(re.findall('[\u4e00-\u9fa5]',str1)))
posted @ 2023-06-05 15:00  布都御魂  阅读(48)  评论(0)    收藏  举报