lua-users home
lua-l archive

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


On 02/10/2018 12:30 PM, Egor Skriptunoff wrote:
> Exactly the same could be done using Lua patterns:
> 
> for _,s in ipairs(list) do
>   s = s:gsub("\\?.", {['"']='\0\0"', ["'"]="\0\0'", [","]="\0,"})
>        :gsub("((%z%z.).-)%2", function(a,b) return a:gsub("%z,", ",")..b
> end)
>        :gsub("%z,", "~")
>        :gsub("%z", "")
>   print(s)
> end
> 

Looks like an entry for International Obfuscated Lua Code Contest for me.

-- Martin