fork download
  1. r=[' 200 200 200 200 ', ' 3,50 3,50 3,50 3,50 ', ' 1000 1000 1000 1000 ', '1.000 1.000 1.000 1.000 ']
  2.  
  3. import re
  4. I = []
  5. p = re.compile(r"^\s*(\S)|\s{2,}(\S)")
  6. for n in range(0,len(r)):
  7. itemp = []
  8. for m in p.finditer(r[n]):
  9. if (m.group(1)):
  10. itemp.append(m.start(1))
  11. else:
  12. itemp.append(m.start(2))
  13. I.append(itemp)
  14. print(I)
Success #stdin #stdout 0.03s 9984KB
stdin
Standard input is empty
stdout
[[2, 11, 20, 29], [4, 13, 22, 31], [1, 10, 19, 28], [0, 9, 18, 27]]