14,061
edits
m (1 revision) |
m (1 revision) |
||
(One intermediate revision by the same user 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 |