Module:Sandbox/BrownHairedGirl/titleParse

This is the current revision of this page, as edited by BrownHairedGirl (talk | contribs) at 14:00, 31 March 2018 (pagename). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
local p = {}


function p.main(frame)
	local retval = "";
	local thispage = mw.title.getCurrentTitle()
	local pagename = thispage.text;
	
	local title_prefix, title_county, title_suffix = string.match(pagename, "(.*)(County %a+)(.*)")

	retval = retval .. "\n* pagename = [" .. pagename .. "]"
	retval = retval .. "\n** title_prefix = [" .. title_prefix .. "]"
	retval = retval .. "\n** title_county = [" .. title_county .. "]"
	retval = retval .. "\n** title_suffix = [" .. title_suffix .. "]"

	return retval
end

return p