Skip to content

Commit e671353

Browse files
LittleDCirvin
authored andcommitted
Page not found of '\n' in Regular_Expressions page
the original link of '\n'(https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Regular_Expressions$edit#special-backreference) points to Page not found
1 parent d56d465 commit e671353

File tree

1 file changed

+1
-1
lines changed
  • files/zh-cn/web/javascript/guide/regular_expressions

1 file changed

+1
-1
lines changed

files/zh-cn/web/javascript/guide/regular_expressions/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ <h3 id="使用特殊字符">使用特殊字符</h3>
142142
<td>
143143
<p>像下面的例子展示的那样,它会匹配 'x' 并且记住匹配项。其中括号被称为<em>捕获括号</em></p>
144144

145-
<p>模式 <code>/(foo) (bar) \1 \2/</code> 中的 '<code>(foo)</code>' 和 '<code>(bar)</code>' 匹配并记住字符串 "foo bar foo bar" 中前两个单词。模式中的 <code>\1</code><code>\2</code> 表示第一个和第二个被捕获括号匹配的子字符串,即 <code>foo</code><code>bar</code>,匹配了原字符串中的后两个单词。注意 <code>\1</code><code>\2</code>、...、<code>\n</code> 是用在正则表达式的匹配环节,详情可以参阅后文的 <a href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Regular_Expressions$edit#special-backreference">\n</a> 条目。而在正则表达式的替换环节,则要使用像 <code>$1</code><code>$2</code>、...、<code>$n</code> 这样的语法,例如,<code>'bar foo'.replace(/(...) (...)/, '$2 $1')</code><code>$&amp;</code> 表示整个用于匹配的原字符串。</p>
145+
<p>模式 <code>/(foo) (bar) \1 \2/</code> 中的 '<code>(foo)</code>' 和 '<code>(bar)</code>' 匹配并记住字符串 "foo bar foo bar" 中前两个单词。模式中的 <code>\1</code><code>\2</code> 表示第一个和第二个被捕获括号匹配的子字符串,即 <code>foo</code><code>bar</code>,匹配了原字符串中的后两个单词。注意 <code>\1</code><code>\2</code>、...、<code>\n</code> 是用在正则表达式的匹配环节,详情可以参阅后文的 <a href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Regular_Expressions#special-backreference">\n</a> 条目。而在正则表达式的替换环节,则要使用像 <code>$1</code><code>$2</code>、...、<code>$n</code> 这样的语法,例如,<code>'bar foo'.replace(/(...) (...)/, '$2 $1')</code><code>$&amp;</code> 表示整个用于匹配的原字符串。</p>
146146
</td>
147147
</tr>
148148
<tr>

0 commit comments

Comments
 (0)