api: fix pattern for decimals

This commit is contained in:
shagu
2017-09-28 21:08:35 +02:00
parent b65b735129
commit 2c6ce715bb
+2 -1
View File
@@ -89,13 +89,14 @@ end
-- Sanitizes and convert patterns into gfind compatible ones.
-- 'pattern' [string] unformatted pattern
-- returns: [string] simplified gfind compatible pattern
function SanitizePattern(pattern)
function pfUI.api.SanitizePattern(pattern)
-- escape brackets
pattern = gsub(pattern, "%(", "%%(")
pattern = gsub(pattern, "%)", "%%)")
-- remove bad capture indexes
pattern = gsub(pattern, "%d%$s","s") -- %1$s to %s
pattern = gsub(pattern, "%d%$d","d") -- %1$d to %d
pattern = gsub(pattern, "%ds","s") -- %2s to %s
-- add capture to all findings