fix(curriculum) : Fixed Wrong Comment of Backreferences Example (#63219)

This commit is contained in:
Hitesh
2025-10-29 18:40:47 +05:30
committed by GitHub
parent 41ddf7eff0
commit 2bd3ec1db8

View File

@@ -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.