fork(5) download
  1. import re
  2. test = ['bbb', 'ccc', 'axx', 'xzz', 'xaa']
  3. reg = re.compile(r'^x')
  4. test = list(filter(reg.search, test))
  5. print(test)
Success #stdin #stdout 0.02s 9376KB
stdin
Standard input is empty
stdout
['xzz', 'xaa']