lua-users home
lua-l archive

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


>>    Change the literal parts of the pattern to be case insensitive:
>
>function gisub(s, pat, repl, n)
>    pat = gsub(pat, '(%a)', 
>               function (v) return '['..strupper(v)..strlower(v)..']' end)

Yes, that's what I meant, but you have to be careful if pat has classes,
such as %a. You might want to first encode all %LETTER by %DECIMAL, do
your conversion above, and then restore %LETTER.

>This might have been asked before, but why didn't you guys make
>`gsub' also accept `nil' for the final parameter?

I don't know :-)
--lhf