Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Answer: How do I surround commas with escaped double-quotes?

by tye (Sage)
on Jan 07, 2001 at 10:36 UTC ( #50322=categorized answer: print w/replies, xml ) Need Help??

Q&A > regular expressions > How do I surround commas with escaped double-quotes? - Answer contributed by tye

$string= "This, that, and those"; $string =~ s/,/\\",\\"/g; print $string;
Prints:
This\",\" that\",\" and those

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the grasshoppers chirp...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2017-04-28 16:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (526 votes). Check out past polls.