fork download
  1. import re
  2.  
  3. text = ("23,\"1,309\",0\n"
  4. "23,\"134,799\",2\n"
  5. ",\"1,549,089\",0\n"
  6. "8908.89,\"27,989\",3")
  7. regex = r'"(?:\d+,)?\d+,\d+"'
  8. print(re.findall(regex, text))
Success #stdin #stdout 0.02s 9544KB
stdin
Standard input is empty
stdout
['"1,309"', '"134,799"', '"1,549,089"', '"27,989"']