Correct a pattern escape for Lua.