Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: regular expression: match multiple newlines

by Lennotoecom (Monk)
on Nov 04, 2013 at 01:22 UTC ( #1061088=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    /(?<=\S)\s*$/ ? ({print "$a$`"},$a="\n") : ($a='EEEEE') while <DATA>;
    
    ...
    
    fish2
    text3 
    
  2. or download this
    dogs rats
    catsEEEEEfish
    text
    cats2EEEEEfish2
    text3
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2014-08-01 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (256 votes), past polls