fork download
  1. import re
  2. s= ''''abc' (17245...64590)
  3. 'cde' (12244...67730)
  4. 'dsa' complement (12345...67890)'''
  5. rx = r"\s{2,}(?:(\w+)\s*)?\((\d+)\.+(\d+)\)"
  6. for x in re.findall(rx, s):
  7. print(", ".join([y for y in x if y]))
Success #stdin #stdout 0s 23352KB
stdin
Standard input is empty
stdout
17245, 64590
12244, 67730
complement, 12345, 67890