Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Re: remove single blank lines?
in thread remove single blank lines?

oops, forgot to login.

qq

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;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://313306]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2024-03-28 09:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found