I have few problems with gsub
I have a table with key/value, the key name its used as keyword for change to his value in a text var (with html)
that not work (matching /*key*/)
for k,v in pairs(tKeys) do
local repl = "/%*" .. k .. "-%*/"
new_tpl = oldtpl.gsub(oldtpl, repl, tKeys[k])
end
some values change wrong things too
that works matching /*somekeyname*/
for k,v in pairs(tKeys) do
local repl = "/%somekeyname-%*/"
new_tpl = oldtpl.gsub(oldtpl, repl, tKeys[somekeyname])
end
Any idea?
Checking other things i trying match [ssid]
new_tpl = oldtpl.gsub(oldtpl, "%[ssid%]", value)
or
new_tpl = oldtpl.gsub(oldtpl, "%[ssid-%]", value)
not work...
what i missed? ins't % the escape character?