From: "Florian Gross" <flgr / ccan.de> > Bill Kelly wrote: > > > I'm probably being dense, but - > > > >>>"ab\\cd".gsub(/\\/, "\\\\") > > Here's the details, this comes up frequently: > > ..gsub adds its own layer of escaping. \1 refers to the first match, \2 > to the second and there is also stuff like \'. (In general those forms > are equivalent to global variables. E.g. \1 => $1) > > Because Ruby's String literals already have one level of escaping you > have to escape everything two times which is confusing. Argh! Thanks....!! I used to know this... :) Regards, Bill