使用re.split 按标点+空格的一种分割办法
import re
import string
t1 = re.split("["+string.punctuation+" ]","(555) 123-4567")
t2= re.split("["+string.punctuation+" ]","555.123.4567")
t1==t2
注意,"]" 前面有一个空格
import re
import string
t1 = re.split("["+string.punctuation+" ]","(555) 123-4567")
t2= re.split("["+string.punctuation+" ]","555.123.4567")
t1==t2
注意,"]" 前面有一个空格