"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/regex.lua" between
imapfilter-2.7.3.tar.gz and imapfilter-2.7.4.tar.gz

About: imapfilter filters/deletes unwanted mails from IMAP servers

regex.lua  (imapfilter-2.7.3):regex.lua  (imapfilter-2.7.4)
-- A simple wrapper for PCRE that uses a cache for compiled expressions. -- A simple wrapper for PCRE that uses a cache for compiled expressions.
_regex_cache = {} _regex_cache = {}
_regex_cache.mt = {} _regex_cache.mt = {}
setmetatable(_regex_cache, _regex_cache.mt) setmetatable(_regex_cache, _regex_cache.mt)
_regex_cache.mt.__index = function (self, key) _regex_cache.mt.__index = function (self, key)
local r, compiled = ifre.compile(pattern) local r, compiled = ifre.compile(key)
if not r then return end if not r then return end
self[key] = compiled self[key] = compiled
return compiled return compiled
end end
function regex_search(pattern, subject) function regex_search(pattern, subject)
_check_required(pattern, 'string') _check_required(pattern, 'string')
_check_required(subject, 'string') _check_required(subject, 'string')
local compiled = _regex_cache[pattern] local compiled = _regex_cache[pattern]
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)