fork(1) download
  1. import re
  2. print([x for x in re.split('(\n|\ +)', 'many fancy word \n\n hello \t hi') if x])
Success #stdin #stdout 0s 23304KB
stdin
Standard input is empty
stdout
['many', '   ', 'fancy', ' ', 'word', ' ', '\n', '\n', '    ', 'hello', '    ', '\t', '   ', 'hi']