Re: Feature request: plain option for gsub
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Feature request: plain option for gsub
- From: Coroutines <coroutines@...>
- Date: 2014年8月22日 01:03:23 -0700
On Fri, Aug 22, 2014 at 12:54 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> What may be more useful than another parameter to gsub would be
> a function string.plain, which returns a pattern that matches the
> exact string. Then one can write
>
> str:gsub(pattern:plain(),repl)
The only issue I have with that would be creating a new string from a
potentially very long one -- just to escape the special characters
within it. I would be much happier telling the pattern matching code
to not interpret special characters directly...