打开/关闭搜索
搜索
打开/关闭菜单
549
7
12
2051
OGAS数据中枢
导航
首页
最近更改
随机页面
特殊页面
上传文件
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
创建账号
登录
查看“︁Module:BilibiliVideoIDValidator”︁的源代码
来自OGAS数据中枢
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
Module:BilibiliVideoIDValidator
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
管理员
您可以查看和复制此页面的源代码。
return { validation = function(frame) local flag = false local id = mw.text.trim(frame.args.id or "") local regex = "[A-HJ-NP-Za-km-z1-9]+$" -- 1. 有明确的 av 前缀且符合 aid 规则 if mw.ustring.match(id, "^[Aa][Vv][1-9]%d*$") then flag = true -- 2. 有明确的 bv 前缀且符合 bvid 规则 elseif string.len(id) == 12 and mw.ustring.match(id, "^[bB][vV]1" .. regex) then flag = true -- 3. 没有明确的前缀,但符合 aid 规则 elseif mw.ustring.match(id, "^[1-9]%d*$") then flag = true -- 4. 没有明确的前缀,但符合 bvid 规则且不符合 aid 规则 elseif string.len(id) == 10 and mw.ustring.match(id, "^1" .. regex) or string.len(id) == 9 and mw.ustring.match(id, "^" .. regex) then flag = true -- 5. 无法判断 end if flag then return "" else return frame.args.result or frame:expandTemplate { title = "ArticleCategory", args = { "Bilibili视频ID错误", }, } .. '<strong class="error BilibiliVideoIDValidatorArgument" style="display:none">' .. frame.args.id .. "</strong>" end end, }
该页面嵌入的页面:
Module:BilibiliVideoIDValidator/doc
(
查看源代码
)
返回
Module:BilibiliVideoIDValidator
。
查看“︁Module:BilibiliVideoIDValidator”︁的源代码
来自OGAS数据中枢