匿名
未登录
创建账号
登录
魔学
搜索
查看“︁Module:Str test”︁的源代码
来自魔学
命名空间
模块
讨论
更多
更多
页面操作
阅读
查看源代码
历史
←
Module:Str test
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local module = {} function module.main(frame) local args = frame.args local str = args[1] local ptn = mw.text.decode(mw.text.unstripNoWiki(args[2])) if mw.ustring.find(str, ptn) == nil then return '' else return 1 end end function module.MultiMatch(frame) local parent = frame:getParent() if parent and parent:getTitle() == "Template:Str substr" then frame = parent end local args = frame.args local str = args[1] local result = "" local i = 2 while(frame.args[i])do local ptn = mw.text.decode(mw.text.unstripNoWiki(args[i])) local found = mw.ustring.match(str, ptn) result = result .. (found and "1" or "0") i = i+1 end return result end function module.Switch(frame) local parent = frame:getParent() if parent and parent:getTitle() == "Template:Str switch" then frame = parent end local str = frame.args[1] for key, value in pairs(frame.args) do if type(key) == "string" and key ~= "#default" then local ptn = mw.text.decode(mw.text.trim(mw.text.unstripNoWiki(value))) if ptn ~= "" and mw.ustring.match(str, ptn) then return key end end end return frame.args["#default"] or "" end return module
此页面嵌入的页面:
Module:Str test/doc
(
查看源代码
)
返回
Module:Str test
。
导航
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
wiki工具
wiki工具
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志