lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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...