[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Finding end of string
- From: Martin <eden_martin_fuhrspam@...>
- Date: Thu, 12 Oct 2017 20:16:01 +0100
On 10/12/2017 07:56 PM, Egor Skriptunoff wrote:
> function end_of_string_literal (text, start_pos, quote)
> return text:gsub("\\?.", {[quote]="\0"}):match("%z()", start_pos)
> end
>
> print(end_of_string_literal ([[a="\"A",b="\\\"B\"",c="C"]], 4, '"')) --> 8
> print(end_of_string_literal ([[a="\"A",b="\\\"B\"",c="C"]], 12, '"')) --> 20
> print(end_of_string_literal ([[a="\"A",b="\\\"B\"",c="C"]], 24, '"')) --> 26
What task this code solves?
-- Martin