lua-users home
lua-l archive

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

I don't think that there is (and agree it would be useful).

I ended up doing the following in my code:
        -- Convert all non-alphanumerics to have a "%" escape character, to
        -- ensure that Lua doesn't interpret them as special characters.
        -- However, this means that any checks in the following code for
        -- non-alphanumerics must check for %[char].
        interest = Text:makeSafe(interest)
        gsub(document, interest, ...)
function Text:makeSafe(text)
    return gsub(text,


----- Original Message -----
From: "Steve Dekorte" <>
To: "Multiple recipients of list" <>
Sent: Wednesday, November 14, 2001 2:45 AM
Subject: gsub without patterns

> Is there a way to use gsub that doesn't treat the first string as a
> "pattern" and just does a straight substring replacement? (Like the
> plain option in strfind) If not, I think this would be a useful addition.
> Steve