On 06 Aug 2001 18:16:04 +0900, Lloyd Zusman wrote:
> ts <decoux / moulon.inra.fr> writes:
> 
> >>>>>> "R" == Renaud HEBERT <renaud.hebert / alcatel.fr> writes:
> > 
> >R> [ ... ]
> >R>
> >R> 4) To replace a single backslash with two, you need to write gsub(/\\/,
> >R> '\\\\\\\\')!! Ouch!
> > 
> >   http://www.rubycentral.com/faq/rubyfaq-9.html#ss9.18
> > 
> >  You can write '\&\&', only 4 characters
> 
> But to replace the letter 'a' with two backslashes, you still have ...
> 
>   gsub(/a/, '\\\\\\\\')
> 
> However, you can also do this:
> 
>   gsub(/\\/){'\\\\'}
> 
> and
> 
>   gsub(/a/){'\\\\'}
> 

What about gsub(/a/) {%Q(\\)} ??

/Erik

-- 
Erik BéČfors               | erik / bagfors.nu
Supporter of free software | GSM +46 733 279 273
fingerprint: 6666 A85B 95D3 D26B 296B 6C60 4F32 2C0B 693D 6E32