Topic: how to progamatically esacape double quoutes " in a string
Hi, I have a string that comes from a form, I think the active record/controller escapes anything that comes in, but saves as the original in the database. When I eval the string if it has double quotes in it unescaped it errors out.
Anyway, assum I have a string "balbabbabab\"dfadfafdadfdfa"adfdfadfaf" and I want to make it
mystring = mystring.gsub(/"/,'\"')
but this replaces all double quotes with \" , so I want to just escape any double quote not already escaped (assuming they may be escaped sometimes and may not be othertimes)
Im sure there is some regex or other ruby magic I could do this real easy