threeNumRegex=re.compile(r''' (?:(?<![\d|\,])\d{1,3}(?=\s)) #匹配只有1-3位数,左边 | (?<![\d|\,])(?:\d{1,3})(?:\,\d{3})+(?=\s) #匹配带有","的情况 ''',re.VERBOSE)text=''' 12 12,333 12,12 4444 234,45,234 873,238,23,222 837,228,112 2211,341,39...