Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Template redirect regex: Difference between revisions

From Neodyland Wiki
Create module to return a table of regular expressions, sorted by descending popularity, for all redirects to a given template as of a certain date
 
m --rm now-redundant bit
Line 7: Line 7:
local tCanonical_templates = {
local tCanonical_templates = {
['Category redirect'] = {  
['Category redirect'] = {  
--the following 11 pages (6 condensed) redirect to [[Template:Category redirect]], in descending order, as of 9/2022:
--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]ate?g?o?r?y?[ _]*[rR]edirect', --505+312+243+1 transclusions
'{{ *[Cc]atr', --21
'{{ *[Cc]atr', --21

Revision as of 18:52, 9 July 2023

Module documentation[ view · edit · history · purge ]
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
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
Contents
Cookies help us deliver our services. By using our services, you agree to our use of cookies.