in reply to Re^5: regexp: removing extra whitespace
in thread regexp: removing extra whitespace

I'd go with

(?<!\S)

so

s/[^\S \n]//g; s/(?<!\S) +| +(?!\S)//g; s/\n\n\K\n+//g;