in reply to Regex Question
If that seems overly complex, then look for runs of newlines, and don't touch the ones that aren't isolated:s/(?<!\n)\n(?!\n)//g;
s/(\n+)/$1 eq "\n" ? "" : $1/eg;
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regex Question
by salvadors (Pilgrim) on Jan 08, 2001 at 00:18 UTC |