From: Andreas Schwarz Date: 2003-07-23T01:55:29+09:00 Subject: Re: String substitution without RegEx ts wrote: >>>>>> "A" == Andreas Schwarz writes: > >A> I wanted to do a simple string substitution, and was surprised to see >A> that there isn't such a method in ruby. I can't use String::(g)sub, >A> because the substitution mustn't be influenced by special chars or >A> backreferences in the pattern and replacement strings. Of course I could >A> write functions to escape regex special chars in the pattern and >A> backreferences in the replacement string, but this is about the ugliest >A> solution I can think of. > > Well Regexp#escape don't do what you want ? I would still need a function to remove backreferences from the replacement string. It's possible, of course, but it hurts me that I have to use such "hacks" for a simple substitution. -- AVR-Tutorial, �ber 350 Links Forum f�r AVRGCC und MSPGCC -> http://www.mikrocontroller.net