in reply to remove single blank lines?
Consider the string below -$text =~ s/(?<=\b)\n(?=\n\b)//g;
What the regex will do is to get rid of the '\n' at the end of line1, which is followed by another \n and a word boundary.This is line1\n \n line3\n \n \n
|
|---|