mirror of
https://github.com/zhayujie/bot-on-anything.git
synced 2026-01-25 17:29:43 +08:00
17 lines
355 B
Python
17 lines
355 B
Python
import re
|
|
|
|
|
|
def contain_chinese(str):
|
|
"""
|
|
判断一个字符串中是否含有中文
|
|
"""
|
|
pattern = re.compile('[\u4e00-\u9fa5]')
|
|
match = pattern.search(str)
|
|
return match != None
|
|
|
|
|
|
def check_prefix(content, prefix_list):
|
|
for prefix in prefix_list:
|
|
if content.startswith(prefix):
|
|
return prefix
|
|
return None |