Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Replace ".." with ","

by afoken (Chancellor)
on Apr 05, 2015 at 14:22 UTC ( [id://1122485]=note: print w/replies, xml ) Need Help??


in reply to [solved] Replace ".." with ","

"." needs to be escaped in regular expressions. Use s/\.{2}/,/g or s/[.]{2}/,/g. The former uses an escaped ".", the latter a character class containing only the "."

Alexander

Updated: First variant should be s/\.{2}/,/g, not s/\.{2}//,/g. Thanks to AnomalousMonk for spotting this bug.

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2025-07-13 02:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.