<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://linguifex.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3Aifmatch</id>
	<title>Module:ifmatch - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://linguifex.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3Aifmatch"/>
	<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:ifmatch&amp;action=history"/>
	<updated>2026-04-22T00:15:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:ifmatch&amp;diff=494632&amp;oldid=prev</id>
		<title>Sware: Created page with &quot;local export = {}  -- index_limit: parameters larger than this can&#039;t be specified as numbered -- parameters. This is so that invocations of {{ifmatch}} like the following work: -- {{ifmatch|s|pattern|if_true|if_false}} function export._getParameters(frame_args, arg_list, index_limit) 	local new_args = {}; 	local index = 1; 	local value; 	 	for _, arg in ipairs(arg_list) do 		value = frame_args[arg] 		if value == nil and index &lt;= index_limit then 			value = frame_args[ind...&quot;</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:ifmatch&amp;diff=494632&amp;oldid=prev"/>
		<updated>2026-04-21T11:04:08Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local export = {}  -- index_limit: parameters larger than this can&amp;#039;t be specified as numbered -- parameters. This is so that invocations of {{ifmatch}} like the following work: -- {{ifmatch|s|pattern|if_true|if_false}} function export._getParameters(frame_args, arg_list, index_limit) 	local new_args = {}; 	local index = 1; 	local value; 	 	for _, arg in ipairs(arg_list) do 		value = frame_args[arg] 		if value == nil and index &amp;lt;= index_limit then 			value = frame_args[ind...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local export = {}&lt;br /&gt;
&lt;br /&gt;
-- index_limit: parameters larger than this can&amp;#039;t be specified as numbered&lt;br /&gt;
-- parameters. This is so that invocations of {{ifmatch}} like the following work:&lt;br /&gt;
-- {{ifmatch|s|pattern|if_true|if_false}}&lt;br /&gt;
function export._getParameters(frame_args, arg_list, index_limit)&lt;br /&gt;
	local new_args = {};&lt;br /&gt;
	local index = 1;&lt;br /&gt;
	local value;&lt;br /&gt;
	&lt;br /&gt;
	for _, arg in ipairs(arg_list) do&lt;br /&gt;
		value = frame_args[arg]&lt;br /&gt;
		if value == nil and index &amp;lt;= index_limit then&lt;br /&gt;
			value = frame_args[index];&lt;br /&gt;
			index = index + 1;&lt;br /&gt;
		end&lt;br /&gt;
		new_args[arg] = value;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return new_args;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function export.ifmatch_helper(frame)&lt;br /&gt;
	local new_args = export._getParameters(&lt;br /&gt;
		frame:getParent().args,&lt;br /&gt;
		{&amp;#039;s&amp;#039;, &amp;#039;pattern&amp;#039;, &amp;#039;start&amp;#039;, &amp;#039;plain&amp;#039;, &amp;#039;unicode&amp;#039;},&lt;br /&gt;
		2&lt;br /&gt;
	)&lt;br /&gt;
	local s = assert(new_args.s)&lt;br /&gt;
	local pattern = assert(new_args.pattern)&lt;br /&gt;
	local start = new_args.start and math.floor(assert(tonumber(newargs.start), &amp;quot;start should be a number&amp;quot;)) or 1&lt;br /&gt;
	local yesno = require(&amp;#039;Module:yesno&amp;#039;)&lt;br /&gt;
	local plain = yesno(new_args.plain)&lt;br /&gt;
	local unicode = new_args.unicode&lt;br /&gt;
	if unicode then&lt;br /&gt;
		unicode = yesno(unicode)&lt;br /&gt;
	else&lt;br /&gt;
		unicode = true&lt;br /&gt;
	end&lt;br /&gt;
	-- If plain is true, mw.ustring.find behaves like string.find and there is&lt;br /&gt;
	-- no point in potentially slowing down matching by using mw.ustring.find.&lt;br /&gt;
	if plain then&lt;br /&gt;
		unicode = false&lt;br /&gt;
	end&lt;br /&gt;
	local find = unicode and mw.ustring.find or string.find&lt;br /&gt;
	return find(s, pattern, start, plain) and &amp;#039;1&amp;#039; or &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return export&lt;/div&gt;</summary>
		<author><name>Sware</name></author>
	</entry>
</feed>