fork(3) download
  1. import re
  2. x = 'STARSHIP_TROOPERS_INVASION_2012_LOCDE'
  3. m = re.search('_\d{4}', x)
  4. print x[:m.end(0)]
  5.  
Success #stdin #stdout 0.01s 7728KB
stdin
Standard input is empty
stdout
STARSHIP_TROOPERS_INVASION_2012