<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://zh.postal.wiki/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E6%9D%BF%3AStr_replace</id>
	<title>模板:Str replace - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://zh.postal.wiki/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E6%9D%BF%3AStr_replace"/>
	<link rel="alternate" type="text/html" href="https://zh.postal.wiki/index.php?title=%E6%A8%A1%E6%9D%BF:Str_replace&amp;action=history"/>
	<updated>2026-11-04T16:50:00Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://zh.postal.wiki/index.php?title=%E6%A8%A1%E6%9D%BF:Str_replace&amp;diff=5794&amp;oldid=prev</id>
		<title>Hehua：​// Edit via Wikiplus</title>
		<link rel="alternate" type="text/html" href="https://zh.postal.wiki/index.php?title=%E6%A8%A1%E6%9D%BF:Str_replace&amp;diff=5794&amp;oldid=prev"/>
		<updated>2026-09-14T03:30:54Z</updated>

		<summary type="html">&lt;p&gt;// Edit via Wikiplus&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年9月14日 (一) 03:30的版本&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-l20&quot;&gt;第20行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第20行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;输出：&amp;#039;&amp;#039;&amp;#039;{{str replace|str=514|ptn=(%d)(%d)(%d)|replace=%3%1%2}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;输出：&amp;#039;&amp;#039;&amp;#039;{{str replace|str=514|ptn=(%d)(%d)(%d)|replace=%3%1%2}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Template:辅助模板}}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[分类:辅助模板]]}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[分类:辅助模板]]}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki:diff:1.41:old-5791:rev-5794:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Hehua</name></author>
	</entry>
	<entry>
		<id>https://zh.postal.wiki/index.php?title=%E6%A8%A1%E6%9D%BF:Str_replace&amp;diff=5791&amp;oldid=prev</id>
		<title>Hehua：​清理失效的 {{Lua}} 标识（功能不受影响，#invoke:String 正常）</title>
		<link rel="alternate" type="text/html" href="https://zh.postal.wiki/index.php?title=%E6%A8%A1%E6%9D%BF:Str_replace&amp;diff=5791&amp;oldid=prev"/>
		<updated>2026-09-14T02:57:45Z</updated>

		<summary type="html">&lt;p&gt;清理失效的 {{Lua}} 标识（功能不受影响，#invoke:String 正常）&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年9月14日 (一) 02:57的版本&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-l1&quot;&gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;includeonly&amp;gt;{{{{{|safesubst:}}}#invoke:String|replace|source={{{str|}}}|pattern={{{{{|safesubst:}}}unwiki|{{{ptn|}}}}}|replace={{{{{|safesubst:}}}unwiki|{{{replace|{{{rep|}}}}}}}}|count={{{count|}}}|plain=false}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;{{doc|content=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;includeonly&amp;gt;{{{{{|safesubst:}}}#invoke:String|replace|source={{{str|}}}|pattern={{{{{|safesubst:}}}unwiki|{{{ptn|}}}}}|replace={{{{{|safesubst:}}}unwiki|{{{replace|{{{rep|}}}}}}}}|count={{{count|}}}|plain=false}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;{{doc|content=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Lua|String}}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 简介 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 简介 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki:diff:1.41:old-3265:rev-5791:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Hehua</name></author>
	</entry>
	<entry>
		<id>https://zh.postal.wiki/index.php?title=%E6%A8%A1%E6%9D%BF:Str_replace&amp;diff=3265&amp;oldid=prev</id>
		<title>Hehua：​导入1个版本</title>
		<link rel="alternate" type="text/html" href="https://zh.postal.wiki/index.php?title=%E6%A8%A1%E6%9D%BF:Str_replace&amp;diff=3265&amp;oldid=prev"/>
		<updated>2026-05-28T14:27:21Z</updated>

		<summary type="html">&lt;p&gt;导入1个版本&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年5月28日 (四) 14:27的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;zh-Hans-CN&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wiki:diff:1.41:old-3264:rev-3265 --&gt;
&lt;/table&gt;</summary>
		<author><name>Hehua</name></author>
	</entry>
	<entry>
		<id>https://zh.postal.wiki/index.php?title=%E6%A8%A1%E6%9D%BF:Str_replace&amp;diff=3264&amp;oldid=prev</id>
		<title>2025年1月13日 (一) 08:32 moegirlmirror&gt;Chi ZJ2</title>
		<link rel="alternate" type="text/html" href="https://zh.postal.wiki/index.php?title=%E6%A8%A1%E6%9D%BF:Str_replace&amp;diff=3264&amp;oldid=prev"/>
		<updated>2025-01-13T08:32:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;includeonly&amp;gt;{{{{{|safesubst:}}}#invoke:String|replace|source={{{str|}}}|pattern={{{{{|safesubst:}}}unwiki|{{{ptn|}}}}}|replace={{{{{|safesubst:}}}unwiki|{{{replace|{{{rep|}}}}}}}}|count={{{count|}}}|plain=false}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;{{doc|content=&lt;br /&gt;
{{Lua|String}}&lt;br /&gt;
&lt;br /&gt;
== 简介 ==&lt;br /&gt;
这个模板将对正则表达式的查询结果进行替换。&lt;br /&gt;
&lt;br /&gt;
若正则未匹配到结果，则输出原字符串。&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;这个模板使用的是Lua的正则表达式（gsub函数）。若遇到Lua正则无法实现的问题，可以考虑使用{{tl|regex}}模板（PHP的正则表达式）。&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== 用法 ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{str replace|str= &amp;lt;!-- 要查询的字符串 --&amp;gt;|ptn= &amp;lt;!-- 正则表达式，支持以&amp;lt;nowiki&amp;gt;标签包裹的格式传入 --&amp;gt;|replace= &amp;lt;!-- 替换目标，支持以&amp;lt;nowiki&amp;gt;标签包裹的格式传入 --&amp;gt;&lt;br /&gt;
|count=&amp;lt;!-- 最多进行的替换次数，默认为全部替换 --&amp;gt;}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 示例 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{str replace|str=514|ptn=(%d)(%d)(%d)|replace=%3%1%2}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;输出：&amp;#039;&amp;#039;&amp;#039;{{str replace|str=514|ptn=(%d)(%d)(%d)|replace=%3%1%2}}&lt;br /&gt;
&lt;br /&gt;
{{Template:辅助模板}}&lt;br /&gt;
[[分类:辅助模板]]}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>moegirlmirror&gt;Chi ZJ2</name></author>
	</entry>
</feed>