Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Regex Question

by ryddler (Monk)
on Jan 07, 2001 at 18:55 UTC ( [id://50370]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Regex Question

How about this?

$text = "This is not good,\n you know what I mean?\n\nThis should be o +n a separate line."; $text =~ s/[^\n](?:\n)|(\n)\n[^\n]/$1/g; print $text;

Which produces this:

This is not good,you know what I mean?
This should be on a separate line.


ryddler

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://50370]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.