Skip to content

Commit 8a6f6c6

Browse files
committed
2 parents 39bb1de + 374eaac commit 8a6f6c6

File tree

1 file changed

+5
-5
lines changed
  • 9-regular-expressions/01-regexp-introduction

1 file changed

+5
-5
lines changed

9-regular-expressions/01-regexp-introduction/article.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ alert( "We will, we will".replace(/we/ig, "I") ); // I will, I will
140140

141141
| 符号 | 在替换字符串中的行为 |
142142
|--------|--------|
143-
|`$&`|插入全部匹配项的内容|
144-
|<code>$&#096;</code>|插入匹配项前面的一段字符串|
145-
|`$'`|插入匹配项后面的一段字符串|
146-
|`$n`|如果 `n` 是一个 1-2 位数,则会插入第 n 个括号中的内容,详见 <info:regexp-groups>|
147-
|`$<name>`|插入名称为 `name` 的括号中的内容,详见 <info:regexp-groups>|
143+
|`$&`|插入整个匹配项|
144+
|<code>$&#096;</code>|插入字符串中匹配项之前的字符串部分|
145+
|`$'`|插入字符串中匹配项之后的字符串部分|
146+
|`$n`|如果 `n` 是一个 1-2 位的数字,则插入第 n 个分组的内容,详见 <info:regexp-groups>|
147+
|`$<name>`|插入带有给定 `name` 的括号内的内容,详见 <info:regexp-groups>|
148148
| `$$` | 插入字符 `$` |
149149

150150
带有 `pattern:$&` 的一个示例:

0 commit comments

Comments
 (0)