fork download
  1. import re
  2. numberRegex = re.compile(r'(?<!\d)(?<!\d[.,])\d{1,3}(?:,\d{3})*(?![.,]?\d)')
  3. mo = numberRegex.findall('41, 1,234, 6,368,745, 12,34,567, 1234')
  4. print(mo)
Success #stdin #stdout 0.04s 9900KB
stdin
Standard input is empty
stdout
['41', '1,234', '6,368,745']