in reply to Re^5: regexp: removing extra whitespacein thread regexp: removing extra whitespace
I'd go with
(?<!\S) [download]
so
s/[^\S \n]//g; s/(?<!\S) +| +(?!\S)//g; s/\n\n\K\n+//g; [download]