lua-users home
lua-l archive

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


> Does anyone have a handy function to unquote a string.format %q
> transformation? I.e. reverse all the quoting performed by %q to revert
> to the original string, before quoting?

Check out the 'unescape_string' function in metalua. See
https://gist.github.com/fab13n/metalua/blob/master/src/compiler/lexer.lua