有谁可以弄清楚为什么这两个结果完全不同:
导入重新
a = re.findall(r'\w+(?=,|\.)',"They were three: Felix, Victor, and Carlos.") ; print(a)
a = re.findall(r'\w+(?=(,|\.))',"They were three: Felix, Victor, and Carlos.") ; print(a)
第一次回归:[' Felix',' Victor',' Carlos']
第二次回复:[',',',','。']
谢谢, 阿斯卡尼奥