Module:Ref info/data explained

----------------------------< C S 1 _ T E M P L A T E _ P A T T E R N S >------------------------------------

These are patterns for cs1 templates and their redirects. These patterns exclude redirects that are vcite-likewhich redirects should be deleted because vcite is not cs1.

local cs1_template_patterns =

----------------------------< C S 2 _ T E M P L A T E _ P A T T E R N S >------------------------------------

These are patterns for cs2 templates redirects.

local cs2_template_patterns =

--2 templates when counting and listing cs1-like templates.

For example: [Cc]ite ar[Xx]ivbecomes Cite arXiv Cite arxiv cite arXiv cite arxiv

local cs12_stripped_list = ; local function add_stripped (name) if not cs12_stripped_list[name] then cs12_stripped_list[name] = true; end end

local function pattern_convert (name) if name:match ('(.-)%[(%a)(%a)%](.*)') then -- mixed case optional letters local l; lead, c, l, tail = name:match ('(.-)%[(%a)(%a)%](.*)'); add_stripped (lead .. c .. tail); -- uppercase add_stripped (lead .. l .. tail); -- lowercase elseif name:match ('^([^%[]+)(%[%%%-%]%?)(.+)$') then -- [%-]? lead, c, tail = name:match ('^([^%[]+)(%[%%%-%]%?)(.+)$'); add_stripped (lead .. tail); -- neither char add_stripped (lead .. ' ' .. tail); -- space add_stripped (lead .. '-' .. tail); -- hyphen elseif name:match ('^([^%[]+)(%[%%%-%]%?)(.+)$') then -- [%-]? lead, c, tail = name:match ('^([^%[]+)(%[%%%-%]%?)(.+)$'); add_stripped (lead .. tail); -- no hyphen add_stripped (lead .. '-' .. tail); -- hyphen elseif name:match ('^([^%[]+)(%[%%%-%])(.+)$') then -- [%-] lead, c, tail = name:match ('^([^%[]+)(%[%%%-%])(.+)$'); add_stripped (lead .. ' ' .. tail); -- space add_stripped (lead .. '-' .. tail); -- hyphen elseif name:match ('^([^%?]+)(%%%-%?)(.+)$') then -- %-? lead, c, tail = name:match ('^([^%?]+)(%%%-%?)(.+)$'); add_stripped (lead .. tail); -- no hyphen add_stripped (lead .. '-' .. tail); -- hyphen elseif name:match ('^(.-)(%%%-)(.+)$') then -- %- lead, c, tail = name:match ('^(.-)(%%%-)(.+)$'); add_stripped (lead .. '-' .. tail); -- hyphen

elseif name:match ('^(.-)(.)%?(.*)$') then -- .? lead, c, tail = name:match ('^(.-)(.)%?(.*)$'); add_stripped (lead .. tail); -- no character add_stripped (lead .. c .. tail); -- character else add_stripped (name); -- no patterns so save as is end end

for _, list in ipairs do for _, pattern in ipairs (list) do local name = pattern:gsub ('^%[(%a)%a%]', '%1'); -- leading character (usually uppercase) pattern_convert (name); name = pattern:gsub ('^%[%a(%a)%]', '%1'); -- leading character (usually lowercase) pattern_convert (name); end end

----------------------------< V C I T E _ T E M P L A T E _ P A T T E R N S >--------------------------------

These are patterns for Vcite-family templates and their redirects.

local vcite_template_patterns =

----------------------------< H A R V _ T E M P L A T E _ P A T T E R N S >----------------------------------

These are patterns for the harv family of templates and their redirects.

local harv_template_patterns = ;

----------------------------< S F N _ T E M P L A T E _ P A T T E R N S >------------------------------------

These are patterns for the sfn family of templates and their redirects.

local sfn_template_patterns = ;

----------------------------< R E F L I S T _ T E M P L A T E _ P A T T E R N S >----------------------------

These are patterns for the reflist template and its redirects.

local reflist_template_patterns = ;

----------------------------< C L E A N U P _ T E M P L A T E _ P A T T E R N S >----------------------------

These are patterns for some of the cleanup templates and their redirects.

local cleanup_template_patterns = ;

----------------------------< D E A D _ L I N K _ T E M P L A T E _ P A T T E R N S >------------------------

These are patterns for the dead link template and its redirects.

local dead_link_template_patterns = ;

----------------------------< W E B A R C H I V E _ T E M P L A T E _ P A T T E R N S >----------------------

These are patterns for the webarchive template and its redirects.

local webarchive_template_patterns = ;

----------------------------< R E F B E G I N _ T E M P L A T E _ P A T T E R N S >--------------------------

These are patterns for the refbegin template and its redirects.

local refbegin_template_patterns =

----------------------------< R P _ T E M P L A T E _ P A T T E R N S >--------------------------------------

These are patterns for the rp template and its redirects.

local rp_template_patterns =

--2 A U T H O R - N A M E _ P A T T E R N S >--------------------------

These are patterns for the cs1|2 author-name parameters.

local authors_param_patterns = ;local author_param_patterns = ;local last_param_patterns = ;

----------------------------< E X P O R T S >----------------------------------------------------------------

return