From bf8bb3163e9b321edd04bacf9cd9d22f8c1e7a8a Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 2 Dec 2018 17:16:31 +0100 Subject: [PATCH] api: fix capture index on strings with brackets --- api/api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/api.lua b/api/api.lua index b85a3209..82c415cc 100644 --- a/api/api.lua +++ b/api/api.lua @@ -129,7 +129,7 @@ local capture_cache = {} function pfUI.api.GetCaptures(pat) local r = capture_cache if not r[pat] then - for a, b, c, d, e in string.gfind(pat, gsub(pat, "%d%$", "%%(.-)$")) do + for a, b, c, d, e in string.gfind(gsub(pat, "%((.+)%)", "%1"), gsub(pat, "%d%$", "%%(.-)$")) do r[pat] = { a, b, c, d, e} end end