moved match_pattern to utils
This commit is contained in:
@ -438,3 +438,12 @@ function send_large_msg_callback(cb_extra, success, result)
|
||||
send_msg(destination, my_text, send_large_msg_callback, cb_extra)
|
||||
end
|
||||
end
|
||||
|
||||
-- Returns a table with matches or nil
|
||||
function match_pattern(pattern, text)
|
||||
local matches = { string.match(text, pattern) }
|
||||
if next(matches) then
|
||||
return matches
|
||||
end
|
||||
-- nil
|
||||
end
|
Reference in New Issue
Block a user