Jump to content

Module:Taxonbar/exists

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Tom.Reding (talk | contribs) at 12:50, 12 November 2019 (Fix escapes). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}

function p.check( frame )
	local pagename = mw.title.getCurrentTitle().baseText
	local content = mw.title.new(pagename):getContent() or ''
	local found = string.match(content, '(?<!%<%-%-[^%<%>]*)%{%{%s*[Tt]axon?[ _-]?[bB]ar(?=%s*[%|%}])(?![^%<%>]*?%-%-%>)') or --5 redirects as of 2019/9
				  string.match(content, '(?<!%<%-%-[^%<%>]*)%{%{%s*[Tt]axonIds'   ..   '(?=%s*[%|%}])(?![^%<%>]*?%-%-%>)')
	if found then return true end
	return false
end

return p