Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Find & Replace

by ercparker (Hermit)
on Aug 10, 2006 at 18:59 UTC ( [id://566686]=note: print w/replies, xml ) Need Help??


in reply to Find & Replace

you can also try this:
while (<DATA>) { s{(?:(?<=23,)|(?<=bye,)),+}{}; print; } __DATA__ Hello,World,23,,,, test,test,test test,test,test test,test,test test,test,test end,bye,,,,

Replies are listed 'Best First'.
Re^2: Find & Replace
by johngg (Canon) on Aug 10, 2006 at 20:41 UTC
    Moving the ,+ outside of the alternation also works.

    while (<DATA>) { s{(?:(?<=23,)|(?<=bye,)),+}{}; print; }

    Cheers,

    JohnGG

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-16 15:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found