1.中文匹配
使用:[u4e00-u9fa5]
进行中文匹配
import re
# 只匹配一个
# mo = r'[u4e00-u9fa5]'
# s = '我爱中国,I LOVE YOU'
# print(re.search(ms,s))
# 连续匹配
# mo = r'[u4e00-u9fa5]+'
# s = '我爱中国,I LOVE YOU'
# print(re.findall(ms,s))
使用:[u4e00-u9fa5]
进行中文匹配
import re
# 只匹配一个
# mo = r'[u4e00-u9fa5]'
# s = '我爱中国,I LOVE YOU'
# print(re.search(ms,s))
# 连续匹配
# mo = r'[u4e00-u9fa5]+'
# s = '我爱中国,I LOVE YOU'
# print(re.findall(ms,s))