Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 taking refuge in the Monastery: (11)
As of 2015-07-28 23:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls