fork(3) download
  1. import re
  2. p = re.compile(r'\[\d+\]')
  3. test_str = "[1]first[2]second[3]third"
  4. print([x for x in p.split(test_str) if x])
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
['first', 'second', 'third']