http://www.perlmonks.org?node_id=1061066


in reply to Re: regular expression: match multiple newlines
in thread regular expression: match multiple newlines

Good point! However, \n\s*\n would replace \n\x20\n --a space surrounded by two newlines--which is not two consecutive newlines, thus the prior \n{2,} suggestion.

Edit: My apologies. Didn't notice the the OP's mentioning the possibility of other whitespace between the newlines.

Replies are listed 'Best First'.
Re^3: regular expression: match multiple newlines
by Cristoforo (Curate) on Nov 03, 2013 at 20:13 UTC
    He stated that there might be spaces between the newlines :-)

      You are indeed correct. My bad. Will strike my postings above.