Skip to content

Commit 9f06601

Browse files
committed
minor
1 parent e30d9d4 commit 9f06601

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

9-regular-expressions/02-regexp-methods/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ Quite often we'd like to reuse parts of the source string, recombine them in the
263263
264264
To do so, we should:
265265
1. First, mark the parts by parentheses in regexp.
266-
2. Use `$1`, `$2` (and so on) in the replacement string to get the content matched by parentheses.
266+
2. Use `$1`, `$2` (and so on) in the replacement string to get the content matched by 1st, 2nd and so on parentheses.
267267
268268
For instance:
269269
@@ -433,7 +433,7 @@ alert( regexp.test(str) ); // false (no match)
433433
434434
435435
````warn header="Same global regexp tested repeatedly may fail to match"
436-
If we apply the same global regexp to different inputs, it may lead to wrong result, because `regexp.test` call advances `regexp.lastIndex` property, so next matches start from non-zero position.
436+
If we apply the same global regexp to different inputs, it may lead to wrong result, because `regexp.test` call advances `regexp.lastIndex` property, so the search in another string may start from non-zero position.
437437
438438
For instance, here we call `regexp.test` twice on the same text, and the second time fails:
439439

0 commit comments

Comments
 (0)