Human: Python: use regular expression to remove the white space from all lines Assistant: 
Here is some code to replace white spaces in string '  a\n b\n c\nd  e' with empty string ''

re.sub('(?m)^[^\\S\\n]+', '', '  a\n b\n c\nd  e')

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.