From: Amishera Amishera Date: 2010-04-01T07:28:41+09:00 Subject: Re: how to solve this regular expression problem Amishera Amishera wrote: > I can do this also: > > s.gsub!(/#(\d+);/) { puts $1; conv_char($1) } > > But I was wondering how to use both the \1 syntax and the function call > together in the gsub call in the first approach. Okay it did solve half of the problem. Other half is how to display a '\' infront. s.gsub!(/#(\d+);/) { '\'+$1.to_i.to_s(8)} is giving some compile error. -- Posted via http://www.ruby-forum.com/.