Module:Unicode data/matching

Hello, you have come here looking for the meaning of the word Module:Unicode data/matching. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:Unicode data/matching, but we will also tell you about its etymology, its characteristics and you will know how to say Module:Unicode data/matching in singular and plural. Everything you need to know about the word Module:Unicode data/matching you have here. The definition of the word Module:Unicode data/matching will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:Unicode data/matching, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
local export = {}

local module_name_aliases = {
	sc = "scripts",
	script = "scripts",
	gc = "category",
	generalcategory = "category",
}

local function get_pattern(prop)
	if type(prop) ~= "string" then
		error("prop is not a string")
	end
	local module_name, value = prop:match "^(%l+):(%a+)$"
	if not module_name then
		error("prop '" .. prop .. "' is invalid")
	end
	module_name = module_name:lower()
	module_name = module_name_aliases or module_name
	
	return require "Module:Unicode data/patterns".make_pattern {
		args = { module = module_name, value = value }
	}
end

local function make_funcs(name, func)
	export = function (str, properties)
		local pattern = properties:map(get_pattern):concat()
		return func(str, pattern)
	end
	
	export = function (frame)
		local args = require "Module:array".shallowCopy(frame.args)
		local str = args:remove(1)
		return export(str, args)
	end
end

make_funcs("remove_all", function (str, pattern)
		return (mw.ustring.gsub(str, "", ""))
	end)

make_funcs("contains_any", function (str, pattern)
		return mw.ustring.find(str, "") ~= nil
	end)

make_funcs("filter", function (str, pattern)
		return (mw.ustring.gsub(str, "", ""))
	end)

return export