import re
s = 'alibaba阿里巴巴' # 待分割字符串
en_letter = '[\u0041-\u005a|\u0061-\u007a]+' # 大小写英文字母
zh_char = '[\u4e00-\u9fa5]+' # 中文字符
print(re.findall(zh_char,s) + re.findall(en_letter,s))
# 输出: ['阿里巴巴', 'alibaba']
范围 | 说明 |
---|---|
\u4e00-\u9fa5 | 汉字的unicode范围 |
\u0030-\u0039 | 数字的unicode范围 |
\u0041-\u005a | 大写字母unicode范围 |
\u0061-\u007a | 小写字母unicode范围 |