import reprint([x for x in re.split('(\n|\ +)', 'many fancy word \n\n hello \t hi') if x])
Standard input is empty
['many', ' ', 'fancy', ' ', 'word', ' ', '\n', '\n', ' ', 'hello', ' ', '\t', ' ', 'hi']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!