Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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?
Corion is mildly surprised as some different toy projects coagulate into a useful application. I've been toying with writing a Meetup wrapper and also have been toying with synchronizing events between (CalDAV) calendars, and now that means I can ...
[Corion]: ... easily* synchronize my personal calendar with Meetup and import stuff from Meetup there
[Corion]: * Code not yet written, some restrictions may apply

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2017-02-23 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (343 votes). Check out past polls.