fork download
  1. import re
  2. s = '4of Fo1r pe6ople g3ood th5e the2 7asd 8aaa 9fff 10sad'
  3.  
  4. res = re.findall(r'\b(\w*?(\d+)\w*?)\b', s)
  5. res.sort(key=lambda x: int(x[1]))
  6. print(' '.join(l[0] for l in res))
Success #stdin #stdout 0.03s 9640KB
stdin
Standard input is empty
stdout
Fo1r the2 g3ood 4of th5e pe6ople 7asd 8aaa 9fff 10sad