From: Jano Svitok Date: 2008-07-25T23:14:30+09:00 Subject: Re: weird backsplash behaviour inside single quotes On Fri, Jul 25, 2008 at 15:34, Michal Suchanek wrote: > Hello > > I observe that backslashed characters normally produce backaslash plus > the character inside single quotes. > > > The understandable exception are single quotes. However, in Ruby > double backslash also produces a single backslash. > > irb(main):008:0> '\a' > => "\\a" > irb(main):009:0> '\\a' > => "\\a" > irb(main):010:0> '\\\a' > => "\\\\a" > irb(main):011:0> '\\\\a' > => "\\\\a" > irb(main):012:0> > > > I think this is needlessly confusing. Usually single quotes are as > literal as possible. \ is escaped because it is used to escape single quotes.