[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: Mon, 25 Aug 2014 10:03:05 +0200
Sure but it is available & nicely easy for string.find as of now, so
I'm not suggesting something that would be like a huge addition or out
of the scope what the Lua core does right now.
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).
And there is no compelling reason that gsub doesn't have a plain
option, except that it just doesn't have one. find has it, why not
gsub? I bet it wouldn't even take much lines of code to add.
Or just add a basic additional replace function.
Regards,
Jonas Thiem
PS: for the record, I'm not for bloating up Lua infinitely either. In
fact, I'd also support removing patterns entirely and just have a
basic find/replace that works. I find that more essential to have, and
for "proper" regular expressions similar to what perl is capable of,
one would need an additional lib anyway.
On Mon, Aug 25, 2014 at 9:33 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 2014-08-25 5:51 GMT+02:00 Jonas Thiem <jonasthiem@googlemail.com>:
>
>> Well, all I would suggest is adding a plain option to gsub. ;-)
>>
>> But this has all derailed so I don't know what this thread is about anymore
>
> Sooner or later, in any thread dealing with the string library,
> someone says "but it's easy in LPeg" and there we go.
>
- References:
- Re: Feature request: plain option for gsub, Sean Conner
- Re: Feature request: plain option for gsub, Petite Abeille
- Re: Feature request: plain option for gsub, Tom N Harris
- Re: Feature request: plain option for gsub, Dirk Laurie
- Re: Feature request: plain option for gsub, Coroutines
- Re: Feature request: plain option for gsub, Dirk Laurie
- 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