Module:Template redirect regex: Difference between revisions
From Neodyland Wiki
More actions
--regex for the 1st pipe and surrounding whitespace are purposefully omitted to give the calling modules more flexibility |
m Protected "Module:Template redirect regex": High-risk template or module: 26510 transclusions (more info) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)) |
(No difference)
| |
Revision as of 18:00, 16 July 2023
This documentation is transcluded from Module:Template redirect regex/doc.
local p = {}
--returns a table of regular expressions, sorted by descending popularity, for all redirects to a given template as of a certain date, or nil
--regex for the 1st pipe and surrounding whitespace are purposefully omitted to give the calling modules more flexibility
function p.main( template )
--expand the following table as-needed, following the same format
local tCanonical_templates = {
['Category redirect'] = {
--the following 11 pages (6 condensed) redirect to [[Template:Category redirect]], as of 9/2022:
'{{ *[Cc]ate?g?o?r?y?[ _]*[rR]edirect', --505+312+243+1 transclusions
'{{ *[Cc]atr', --21
'{{ *[Cc]at[ _]*[rR]edir', --5+3
'{{ *[Cc]at[ _]*[rR]ed', --3+2
'{{ *[Cc]at[ _]*[mM]ove', --1
'{{ *[Cc]ategory[ _]*[mM]ove', --0
},
}
return tCanonical_templates[template] or nil
end
return p