import re  
# 使用正则表达式拆分字符串  
text = "apple, banana; cherry. date"  
# 以逗号、分号或句点作为分隔符  
parts = re.split('[,;.]', text)  
print(parts)  # 输出: ['apple', ' banana', ' cherry', ' date']  
# 限制拆分次数  
limited_parts = re.split('[,;.]', text, maxsplit=2)  
print(limited_parts)  # 输出: ['apple', ' banana', ' cherry. date']
