From: David Springer Date: 2010-04-01T08:47:39+09:00 Subject: Re: how to solve this regular expression problem --000e0cd70634d7b9f10483215e8f Content-Type: text/plain; charset=ISO-8859-1 On Wed, Mar 31, 2010 at 6:13 PM, Max Schmidt < max.schmidt.privat@googlemail.com> wrote: > >s.gsub!(/#(\d+);/) { '\'+$1.to_i.to_s(8)} > > >is giving some compile error. > > You have to escape the slash (\) like this > > >s.gsub!(/#(\d+);/) { '\\'+$1.to_i.to_s(8)} > -- > Posted via http://www.ruby-forum.com/. > > try either of these: s.gsub!(/#(\d+);/, "\134\134#{conv_char($)}") s.gsub!(/#(\d+);/, "\134\134#{$1.to_i.to_s(8)}") -- David --000e0cd70634d7b9f10483215e8f--