escaping - Ruby gsub doesn't escape single-quotes -


I do not know what's going on here, how do I feed the jib to get the string "Yaho \ 'o? / P>

  & gt; "Yaho'o" .gub ("Y", "\\ Y") = & gt; "\\ Yaho'o"> & gt; "Yaho'o" .gub ("',' \\ '") => "Yahoo" "  

\ 'means $ is' which is everything after the escape escapes again And it works

  "Yaho'o" .gsub ("',' \\\ '' ')  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -