in reply to Re^4: regex doubt on excluding
in thread regex doubt on excluding

I just tried jellisii2's solution, s/^\s*$/\n/mg, and it worked without the non-greedy modifier. Each matching line was replaced by a single newline.