<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.easyuo.com/openeuo/wiki/index.php?action=history&amp;feed=atom&amp;title=String.gsub</id>
		<title>String.gsub - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.easyuo.com/openeuo/wiki/index.php?action=history&amp;feed=atom&amp;title=String.gsub"/>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=String.gsub&amp;action=history"/>
		<updated>2026-05-01T12:53:13Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>http://www.easyuo.com/openeuo/wiki/index.php?title=String.gsub&amp;diff=152&amp;oldid=prev</id>
		<title>76.184.213.234 at 03:58, 8 October 2010</title>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=String.gsub&amp;diff=152&amp;oldid=prev"/>
				<updated>2010-10-08T03:58:23Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 03:58, 8 October 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l33&quot; &gt;Line 33:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  --&amp;gt; x=&amp;quot;lua-5.1.tar.gz&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  --&amp;gt; x=&amp;quot;lua-5.1.tar.gz&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[String.find]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[http://www.lua.org/manual/5.1/manual.html#5.4.1 Lua Manual - String Patterns]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[http://www.lua.org/manual/5.1/manual.html#5.4.1 Lua Manual - String Patterns]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>76.184.213.234</name></author>	</entry>

	<entry>
		<id>http://www.easyuo.com/openeuo/wiki/index.php?title=String.gsub&amp;diff=142&amp;oldid=prev</id>
		<title>76.184.213.234: Created page with &quot;string.gsub (s, pattern, repl [, n]) Returns a copy of s in which all (or the first n, if given) occurrences of the pattern have been replaced by a replacement string specified b...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=String.gsub&amp;diff=142&amp;oldid=prev"/>
				<updated>2010-10-08T03:52:09Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;string.gsub (s, pattern, repl [, n]) Returns a copy of s in which all (or the first n, if given) occurrences of the pattern have been replaced by a replacement string specified b...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;string.gsub (s, pattern, repl [, n])&lt;br /&gt;
Returns a copy of s in which all (or the first n, if given) occurrences of the pattern have been replaced by a replacement string specified by repl, which can be a string, a table, or a function. gsub also returns, as its second value, the total number of matches that occurred.&lt;br /&gt;
&lt;br /&gt;
If repl is a string, then its value is used for replacement. The character % works as an escape character: any sequence in repl of the form %n, with n between 1 and 9, stands for the value of the n-th captured substring (see below). The sequence %0 stands for the whole match. The sequence %% stands for a single %.&lt;br /&gt;
&lt;br /&gt;
If repl is a table, then the table is queried for every match, using the first capture as the key; if the pattern specifies no captures, then the whole match is used as the key.&lt;br /&gt;
&lt;br /&gt;
If repl is a function, then this function is called every time a match occurs, with all captured substrings passed as arguments, in order; if the pattern specifies no captures, then the whole match is passed as a sole argument.&lt;br /&gt;
&lt;br /&gt;
If the value returned by the table query or by the function call is a string or a number, then it is used as the replacement string; otherwise, if it is false or nil, then there is no replacement (that is, the original match is kept in the string).&lt;br /&gt;
&lt;br /&gt;
Here are some examples:&lt;br /&gt;
&lt;br /&gt;
     x = string.gsub(&amp;quot;hello world&amp;quot;, &amp;quot;(%w+)&amp;quot;, &amp;quot;%1 %1&amp;quot;)&lt;br /&gt;
     --&amp;gt; x=&amp;quot;hello hello world world&amp;quot;&lt;br /&gt;
     &lt;br /&gt;
     x = string.gsub(&amp;quot;hello world&amp;quot;, &amp;quot;%w+&amp;quot;, &amp;quot;%0 %0&amp;quot;, 1)&lt;br /&gt;
     --&amp;gt; x=&amp;quot;hello hello world&amp;quot;&lt;br /&gt;
     &lt;br /&gt;
     x = string.gsub(&amp;quot;hello world from Lua&amp;quot;, &amp;quot;(%w+)%s*(%w+)&amp;quot;, &amp;quot;%2 %1&amp;quot;)&lt;br /&gt;
     --&amp;gt; x=&amp;quot;world hello Lua from&amp;quot;&lt;br /&gt;
     &lt;br /&gt;
     x = string.gsub(&amp;quot;home = $HOME, user = $USER&amp;quot;, &amp;quot;%$(%w+)&amp;quot;, os.getenv)&lt;br /&gt;
     --&amp;gt; x=&amp;quot;home = /home/roberto, user = roberto&amp;quot;&lt;br /&gt;
     &lt;br /&gt;
     x = string.gsub(&amp;quot;4+5 = $return 4+5$&amp;quot;, &amp;quot;%$(.-)%$&amp;quot;, function (s)&lt;br /&gt;
           return loadstring(s)()&lt;br /&gt;
         end)&lt;br /&gt;
     --&amp;gt; x=&amp;quot;4+5 = 9&amp;quot;&lt;br /&gt;
     &lt;br /&gt;
     local t = {name=&amp;quot;lua&amp;quot;, version=&amp;quot;5.1&amp;quot;}&lt;br /&gt;
     x = string.gsub(&amp;quot;$name-$version.tar.gz&amp;quot;, &amp;quot;%$(%w+)&amp;quot;, t)&lt;br /&gt;
     --&amp;gt; x=&amp;quot;lua-5.1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://www.lua.org/manual/5.1/manual.html#5.4.1 Lua Manual - String Patterns]&lt;/div&gt;</summary>
		<author><name>76.184.213.234</name></author>	</entry>

	</feed>