<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://igoaddons.eu.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AStringReplace</id>
	<title>Module:StringReplace - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://igoaddons.eu.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AStringReplace"/>
	<link rel="alternate" type="text/html" href="http://igoaddons.eu.org/index.php?title=Module:StringReplace&amp;action=history"/>
	<updated>2026-04-27T08:43:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0-rc.0</generator>
	<entry>
		<id>http://igoaddons.eu.org/index.php?title=Module:StringReplace&amp;diff=3466&amp;oldid=prev</id>
		<title>Admin: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://igoaddons.eu.org/index.php?title=Module:StringReplace&amp;diff=3466&amp;oldid=prev"/>
		<updated>2015-11-01T05:48:28Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 05:48, 1 November 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
		
	</entry>
	<entry>
		<id>http://igoaddons.eu.org/index.php?title=Module:StringReplace&amp;diff=3465&amp;oldid=prev</id>
		<title>קיפודנחש: typos (&quot;occurence&quot; =&gt; &quot;occurrence&quot;)</title>
		<link rel="alternate" type="text/html" href="http://igoaddons.eu.org/index.php?title=Module:StringReplace&amp;diff=3465&amp;oldid=prev"/>
		<updated>2014-02-20T16:08:43Z</updated>

		<summary type="html">&lt;p&gt;typos (&amp;quot;occurence&amp;quot; =&amp;gt; &amp;quot;occurrence&amp;quot;)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Module for different search and replace operations on strings.&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Takes one string parameter, and returns the string with all characters with special meaning for Lua patterns escaped with a preceding `%`.&lt;br /&gt;
function p.escape_pattern(text)&lt;br /&gt;
    -- Replaces each occurrence of any of ().%+-*?[^$ with a `%` and then the character.&lt;br /&gt;
    local r = string.gsub(text, &amp;quot;[%(%)%.%%%+%-%*%?%[%^%$]&amp;quot;, &amp;quot;%%%1&amp;quot;)&lt;br /&gt;
    return r&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Returns the first parameter, with all occurrences of the second parameter replaced with the third parameter.&lt;br /&gt;
-- All special characters are ignored: {{#invoke:StringReplace|replace_all|test.a%1$foo|%1|bar}} results in `test.abarfoo`.&lt;br /&gt;
function p.replace_all(frame)&lt;br /&gt;
    local str = frame.args[1]&lt;br /&gt;
    local strToFind = frame.args[2]&lt;br /&gt;
    local strToreplaceWith = frame.args[3]&lt;br /&gt;
    local r = string.gsub(str, p.escape_pattern(strToFind), p.escape_pattern(strToreplaceWith))&lt;br /&gt;
    return r&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p['encode wiki page name'] = function( frame )&lt;br /&gt;
	local x = mw.ustring.gsub( &lt;br /&gt;
		frame.args[1] or '', &lt;br /&gt;
		'[\'&amp;quot;&amp;amp;_]', &lt;br /&gt;
		{ &lt;br /&gt;
			[&amp;quot;'&amp;quot;] = '&amp;amp;#39;', &lt;br /&gt;
			['&amp;quot;'] = '&amp;amp;#34;', &lt;br /&gt;
			['&amp;amp;'] = '&amp;amp;#38;', &lt;br /&gt;
			['_'] = ' ', &lt;br /&gt;
		} &lt;br /&gt;
	)&lt;br /&gt;
	return mw.text.trim( x )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>קיפודנחש</name></author>
		
	</entry>
</feed>