From: "Ralf Müller" Date: 2005-05-04T23:20:21+09:00 Subject: Re: writing to a file with gsub! On Wed, 4 May 2005 23:06:21 +0900 James Edward Gray II wrote: > 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. > Great. At last i can get rid of these perl one-liners. best regards ralf