Module:TableTools: Difference between revisions

iw>Mr. Stradivarius
escape prefix and suffix strings in affixNums so that magic characters are interpreted literally
 
>PJosepherum
m 1 revision
 
(2 intermediate revisions by 2 users not shown)
Line 136: Line 136:
local function cleanPattern(s)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
s = s:gsub('([()%%.%[%]*+-?^$])', '%%%1')
s = s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
return s
return s
end
end