Perl: the Markov chain saw | |
PerlMonks |
Re: Re: remove single blank lines?by qq (Hermit) |
on Dec 08, 2003 at 23:33 UTC ( [id://313306]=note: print w/replies, xml ) | Need Help?? |
oops, forgot to login. Update: as ysth shows below, my code performs poorly. Why the forward and negative lookarounds aren't working as I expected them to defeats me right now. This regex works much better: s/(^|[^\n])\n{2}([^\n]|$)/$1\n$2/g;
In Section
Seekers of Perl Wisdom
|
|