汉字unicode编码范围
- 匹配简体和繁体 :\u4E00-\u9FFF
- 匹配简体 :\u4E00-\u9FA5
def is_contain_chinese(check_str):
"""
判断字符串中是否包含中文
:param check_str: 需要检测的字符串
:return: 包含返回True, 不包含返回False
"""
for ch in check_str:
if '\u4e00' <= ch <= '\u9fff':
return True
return False
is_contain_chinese('hellos- dd')
>>>>> False
is_contain_chinese('我llos- dd')
>>>>> True