Your version deletes empty lines, but the version you quoted deletes lines that are blank or only have white space.
Edit to be more helpful:
^ is the start of a line
\s is a space character
* means "zero or more of the previous character"
$ is the end of a line