[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Feature request: plain option for gsub
- From: Jonas Thiem <jonasthiem@...>
- Date: Wed, 27 Aug 2014 10:54:27 +0200
So what about getting this into the reference manual?
I think the reference manual should contain the necessary explanation
how to do a replace without pattern processing. I checked on PiL for a
lot of things and it has a couple of neat tricks, but this isn't
something that I should need to check a hint book for (IMHO)
A simple short side note which tells the reader about ^%W for safely
escaping all patterns in the section on the standard lib/string.gsub
would be sufficient.
Regards,
Jonas Thiem
On 08/25/2014 07:10 PM, Roberto Ierusalimschy wrote:
>> And all the suggested options for gsub seem not totally foolproof or
>> not easy (not trivially easy for beginners, and the %p seems to depend
>> on locale which doesn't sound like a good idea if this is meant to be
>> secure in all cases - and it's not entirely obvious to beginners
>> either).
>
> Forget %p, if you cannot understand locales. Use ^%W, as several others
> already mentioned in this thread, and as PiL recommends. (BTW, a good
> book, for beginners too ;)
>
> -- Roberto
>
- References:
- Re: Feature request: plain option for gsub, Axel Kittenberger
- Re: Feature request: plain option for gsub, Coroutines
- Re: Feature request: plain option for gsub, Sean Conner
- Re: Feature request: plain option for gsub, Coroutines
- Re: Feature request: plain option for gsub, Sean Conner
- Re: Feature request: plain option for gsub, Dirk Laurie
- Re: Feature request: plain option for gsub, Andrew Starks
- Re: Feature request: plain option for gsub, Jonas Thiem
- Re: Feature request: plain option for gsub, Dirk Laurie
- Re: Feature request: plain option for gsub, Jonas Thiem
- Re: Feature request: plain option for gsub, Roberto Ierusalimschy