[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: unescape lua string (opposite of %q)
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sat, 5 Jun 2010 03:01:24 -0300
> Hmm, I must be slow. I can't figure out how to convert a string with represented control characters into a string with actual control characters.
>
> E.g.:
>
> local input = [[ line 1\nline2 ]]
>
> str:gsub("\\(.)", '\%1') -- doesn't work
control={n="\n", r="\r"} -- fill as needed
str:gsub("\\(.)", control)