Module:FindOptions

local p = {}

-- (if the construction pattern in Template:Options changes, -- please remember to also change search_pattern accordingly!) local search_pattern = ' .-%[%^%+%]%].-%[%[' .. '(.-)' .. '%]%]' .. '(.-)' .. '</[hs][3m]'

function p.main(frame) -- table of all found action name strings local actions = {} -- wiki text of page to embed that we want to find option names in, -- usually everything following the == Options: == section heading local page_text = frame.args[1] or frame:getParent.args[1] -- loop over matches found in page text local i = 0 for action_name in mw.ustring.gmatch(text, search_pattern) do	   i = i+1 actions[i] = action_name end return actions end return p