mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 18:32:22 +00:00
commit
5eb76ed539
@ -376,7 +376,7 @@ String.prototype.replaceAll(searchValue, replacement)
|
||||
|
||||
`replaceAll()`的第二个参数`replacement`是一个字符串,表示替换的文本,其中可以使用一些特殊字符串。
|
||||
|
||||
- `$&`:匹配的子字符串。
|
||||
- `$&`:匹配的字符串。
|
||||
- `` $` ``:匹配结果前面的文本。
|
||||
- `$'`:匹配结果后面的文本。
|
||||
- `$n`:匹配成功的第`n`组内容,`n`是从1开始的自然数。这个参数生效的前提是,第一个参数必须是正则表达式。
|
||||
|
Loading…
x
Reference in New Issue
Block a user