From: "Ralf Müller" Date: 2005-05-04T22:59:18+09:00 Subject: Re: writing to a file with gsub! 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? '\1'+"\n" will not work