mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-25 14:01:44 -04:00
fix(curriculum) : Fixed Wrong Comment of Backreferences Example (#63219)
This commit is contained in:
@@ -64,7 +64,7 @@ In a `replace` call, you achieve a backreference by using a dollar sign (`$`) fo
|
||||
|
||||
```js
|
||||
const regex = /free(co+de)camp/i;
|
||||
console.log("freecoooooooodecamp".replace(regex, "paid$1world")); // paidcooooooooworld
|
||||
console.log("freecoooooooodecamp".replace(regex, "paid$1world")); // paidcoooooooodeworld
|
||||
```
|
||||
|
||||
We have now successfully preserved an unknown number of `o` characters when converting `freecodecamp` into `paidcodeworld`. But backreferences aren't just limited to the replace call. You can actually use them directly in a regular expression.
|
||||
|
||||
Reference in New Issue
Block a user