Module:Sandbox/MonkeysHK

local table = require('Module:Table') local checkType = require('Module:LibraryUtil').checkTypeLight local p = {}

- -- function: allMatched(s: string, t: table) -- -- Attempt to match each pattern in the table/subsequent args, -- then return true if all matches exists - function p.allMatched(s, ...) checkType('allMatched', 1, s, 'string') local t = { ... }	if t[1] == 'table' then t = t[1] end for _, v in ipairs(t) do		if not(s:match(v)) then return false end end return true end

- -- function: anyMatched(t: table, customFn?: table|generator) -- -- Attempt to match each pattern in the table/subsequent args, -- returns true if any match exists - function p.anyMatched(s, ...) checkType('allMatched', 1, s, 'string') local t = { ... }	if t[1] == 'table' then t = t[1] end for _, v in ipairs(t) do		if s:match(v) then return true end end return false end

function p.subAll(s, ...) end

return p