From: Robert Feldt Date: 2001-03-06T21:11:31+09:00 Subject: [ruby-talk:12121] Re: String.gsub() On Tue, 6 Mar 2001, Mike Bowler wrote: > I'm a little confused about the solution. Why would we need the extra \ > before the \1 just because an escaped quote was nearby? Is this just > wierdness in the ruby parser or is there an actual reason for this? Now, > I'm just curious :-) > When using "" the \ character is used as an escape character so that for example "\t" is ONE char called tab. If you want to have a string with \1 in it you need to write "\\1" since \\ is used to get ONE actual \ in the string. However you can also use '\1' since there are no \ cahrs in '' strings. Hope this makes it clearer. /R