<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.figuramc.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AReplace</id>
	<title>Module:Replace - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.figuramc.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AReplace"/>
	<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Module:Replace&amp;action=history"/>
	<updated>2026-05-29T17:42:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.figuramc.org/index.php?title=Module:Replace&amp;diff=635&amp;oldid=prev</id>
		<title>PenguinEncounter: Create module</title>
		<link rel="alternate" type="text/html" href="https://wiki.figuramc.org/index.php?title=Module:Replace&amp;diff=635&amp;oldid=prev"/>
		<updated>2024-10-25T06:22:17Z</updated>

		<summary type="html">&lt;p&gt;Create module&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;return {&lt;br /&gt;
	repl = function(frame)&lt;br /&gt;
		local args = frame.args&lt;br /&gt;
		local argc = 1&lt;br /&gt;
		local function nextarg() argc = argc + 1 return args[argc - 1] end&lt;br /&gt;
		local input_data = args[&amp;quot;in&amp;quot;] or nextarg()&lt;br /&gt;
		if not input_data then error &amp;quot;No input data (parameter &amp;#039;in&amp;#039; or #1)&amp;quot; end&lt;br /&gt;
		local named = not not args.match1&lt;br /&gt;
		local repl_count = 0&lt;br /&gt;
		while true do&lt;br /&gt;
			repl_count = repl_count + 1&lt;br /&gt;
			local matcher = named and args[&amp;quot;match&amp;quot;..repl_count] or nextarg()&lt;br /&gt;
			local replacement = named and args[&amp;quot;repl&amp;quot;..repl_count] or nextarg()&lt;br /&gt;
			if not (matcher and replacement) then &lt;br /&gt;
				error(&amp;quot;Incomplete match/replacement pair #&amp;quot; .. repl_count)&lt;br /&gt;
			end&lt;br /&gt;
			input_data = input_data:gsub(matcher, replacement)&lt;br /&gt;
		end&lt;br /&gt;
		return input_data&lt;br /&gt;
	end&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>PenguinEncounter</name></author>
	</entry>
</feed>