Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: regular expression: match multiple newlines

by Lennotoecom (Pilgrim)
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?
[LanX]: It seems that PHP's official docs use "closure" and "anonymous function" interchangeably, even though their closures don't capture surrounding state without using the 'use' language construct.
LanX explains much cargo bla ...
[Eily]: what? I thought PHP was known for its reliable and consistent behaviour and documentation!
[LanX]: ... and a lot of pseudo Perl experts
[Eily]: though honestly, I'm sure I have seen people use closure to mean anonysub for perl as well

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (13)
As of 2018-02-23 17:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (303 votes). Check out past polls.

    Notices?