From: James Edward Gray II Date: 2005-05-04T23:06:21+09:00 Subject: Re: writing to a file with gsub! On May 4, 2005, at 8:59 AM, Ralf M�ller wrote: > On Wed, 4 May 2005 22:30:07 +0900 > "Robert Klemme" wrote: > > >> But it's simpler - as simple as >> >> ruby -pi.bak -e 'gsub /\d+/, "###"' your_file >> > > But what about using \1 and \n in the second argument of gsub. Doesn't > require \1 single-quotes > and \n double quotes? No. If you want to put \1 in double quotes, just add a backslash. "\\1\n" works fine. Hope that helps. James Edward Gray II