Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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??


in reply to regular expression: match multiple newlines

/(?<=\S)\s*$/ ? ({print "$a$`"},$a="\n") : ($a='EEEEE') while <DATA>; __DATA__ dogs rats cats fish text cats2 fish2 text3
output:
dogs rats catsEEEEEfish text cats2EEEEEfish2 text3


Comment on Re: regular expression: match multiple newlines
Select or Download Code

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 exploiting the Monastery: (3)
As of 2015-08-28 22:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (341 votes), past polls