From: Joe Peck Date: 2008-12-18T06:12:03+09:00 Subject: Re: gsub("\\", "\\\\") seems unintuitive Joe Peck wrote: > I stumbled onto this thread trying to figure out a similar problem... Dangit, I didn't mean to post the above message :) Okay, I need to read a site name (like "joe.com") and put a \ in front of the period (so it would be "joe\.com"). I'm having trouble with this, I can't seem to get only ONE \ in front of the period... >> "joe.com".gsub(/\./, "\\\.") => "joe\\.com" >> "joe.com".gsub(/\./, "\\\\.") => "joe\\.com" Anyone have a clue what to do? I'm probably missing something simple. -- Posted via http://www.ruby-forum.com/.