From: Li Chen Date: 2007-06-11T23:08:42+09:00 Subject: Re: why gsub! doesn't work in my script Jason Roelofs wrote: > Backslash ( \ ) is the escape character. If you want to match \ itself, > you > need to escape it ( \\ ). So try these regex's: > > r1_obj=Regexp.escape('1.000000\\$P1G\\1.000000') #pattern > r2_obj=Regexp.escape('2.000000\\$P1G\\2.000000') #replacement > > Jason Thanks, but the replacement still doesn't work. It is my understanding that Regexp#escape method should do the magic work for me. Li -- Posted via http://www.ruby-forum.com/.