fork(1) download
  1. import re
  2. texts = ['error in node occurred in sstlgh8j at 10pm afterabchjk9j after 12pm',
  3. 'error in node occurredsstlgh8j at 10pm after abchjk9j after 12pm']
  4. rx = re.compile(r'\s*(?:abc|sst)\w*')
  5. for mystring in texts:
  6. print(rx.sub('', mystring))
Success #stdin #stdout 0.03s 9616KB
stdin
Standard input is empty
stdout
error in node occurred in at 10pm after after 12pm
error in node occurred at 10pm after after 12pm