Try:
s/\n{2,}/EEEEE/g
Output on your dataset:
dogs rats catsEEEEEfish
The \n{2,} notation matches 2+ newlines.
Edit: My apologies. Didn't notice the the OP's mentioning the possibility of other whitespace between the newlines.
In reply to Re: regular expression: match multiple newlines
by Kenosis
in thread regular expression: match multiple newlines
by wegelin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |