function t.match(u)assert(t.string(u))return function(q)local h,S=t.string(q)if not h then return false,S end if string.match(q,u)==nil then return false,string.format("\037\113 \102\097\105\108\101\100 \116\111 \109\097\116\099\104 \112\097\116\116\101\114\110 \037\113",q,u)end return true end end
--[[**
	ensures value matches string pattern

	@param string pattern to check against

	@returns A function that will return true iff the condition is passed
**--]]
function t.match(pattern)
	assert(t.string(pattern))
	return function(value)
		local stringSuccess, stringErrMsg = t.string(value)
		if not stringSuccess then
			return false, stringErrMsg
		end

		if string.match(value, pattern) == nil then
			return false, string.format("%q failed to match pattern %q", value, pattern)
		end

		return true
	end
end
