I'm trying to find a regular exp that enables me to replace all the line breaks and tabs (\n, \r, \t, etc.), and also any spaces before, after and inbetween by a single space. For example, the string
'Copyright ©\n\t\t\t\n\t\t\t2019\n\t\t\tApple Inc. All rights reserved.'
should turn into
'Copyright © 2019 Apple Inc. All rights reserved.'
Also, in the case that the original string was:
'Copyright © \n\t \t\t\n \t\t\t2019\n\t\t\t Apple Inc. All rights reserved.'
The final result should be the same.
For a single line break, in the most simple case where there were no additional spaces, it would be something like
re.sub(r"\n", " ", html)
But as I don't deal often with regular expressions I don't know how to solve what I'm after.