fork download
  1. import re
  2. w = 'w123 o456 t789-- --'
  3. print(re.sub(r'^(.*\d).*$', r'\1', w, flags=re.S))
Success #stdin #stdout 0s 9024KB
stdin
Standard input is empty
stdout
w123 o456 t789