['%%1/8%%'] = 'H', ['%%ppp%%'] = 'P', ... for k, v in pairs(replacements) do text = string.gsub(text, k, v) end