fork download
  1. import re
  2. rx = r"([^\s\d]+\s+[^\s\d]+) (\d+)"
  3. text = " 2012-15-08 07:05 *** Error importing row no. 5: The import of 785 line failed because of 345 item"
  4. print( re.findall(rx, text))
  5.  
Success #stdin #stdout 0.02s 9384KB
stdin
Standard input is empty
stdout
[('row no.', '5'), ('import of', '785'), ('because of', '345')]