Module:Sandbox/BrownHairedGirl/titleParse

< Module:Sandbox
Revision as of 15:00, 31 March 2018 by imported>BrownHairedGirl (pagename)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Sandbox/BrownHairedGirl/titleParse/doc

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