Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

(Regex Madness) And you thought whitespace was easy.

by japhy (Canon)
on Aug 15, 2001 at 08:17 UTC ( [id://104947]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    s/(\s+)/$1 eq "\n\n" ? $1 : " "/eg;
    
  2. or download this
    ($_ = reverse) =~ s{
      (?:
    ...
      )+                    # one or more times
    }{ }xg;                 # turn it into a single space
    $_ = reverse;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-25 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found