[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Replace specific comma's in a string.
- From: dyngeccetor8 <dyngeccetor8@...>
- Date: Sat, 10 Feb 2018 15:06:54 +0300
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