Merge pull request #2373 from vsemozhetbyt/9.11
Fix typos in 9.11 (Capturing groups)
This commit is contained in:
commit
e1cb0f8690
4 changed files with 4 additions and 4 deletions
|
@ -16,5 +16,5 @@ alert( regexp.test('0132546789AB') ); // false (no colons)
|
||||||
|
|
||||||
alert( regexp.test('01:32:54:67:89') ); // false (5 numbers, must be 6)
|
alert( regexp.test('01:32:54:67:89') ); // false (5 numbers, must be 6)
|
||||||
|
|
||||||
alert( regexp.test('01:32:54:67:89:ZZ') ) // false (ZZ ad the end)
|
alert( regexp.test('01:32:54:67:89:ZZ') ) // false (ZZ at the end)
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
A positive number with an optional decimal part is (per previous task): `pattern:\d+(\.\d+)?`.
|
A positive number with an optional decimal part is: `pattern:\d+(\.\d+)?`.
|
||||||
|
|
||||||
Let's add the optional `pattern:-` in the beginning:
|
Let's add the optional `pattern:-` in the beginning:
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
A regexp for a number is: `pattern:-?\d+(\.\d+)?`. We created it in previous tasks.
|
A regexp for a number is: `pattern:-?\d+(\.\d+)?`. We created it in the previous task.
|
||||||
|
|
||||||
An operator is `pattern:[-+*/]`. The hyphen `pattern:-` goes first in the square brackets, because in the middle it would mean a character range, while we just want a character `-`.
|
An operator is `pattern:[-+*/]`. The hyphen `pattern:-` goes first in the square brackets, because in the middle it would mean a character range, while we just want a character `-`.
|
||||||
|
|
||||||
|
|
|
@ -249,7 +249,7 @@ The call to `matchAll` does not perform the search. Instead, it returns an itera
|
||||||
|
|
||||||
So, there will be found as many results as needed, not more.
|
So, there will be found as many results as needed, not more.
|
||||||
|
|
||||||
E.g. there are potentially 100 matches in the text, but in a `for..of` loop we found 5 of them, then decided it's enough and make a `break`. Then the engine won't spend time finding other 95 matches.
|
E.g. there are potentially 100 matches in the text, but in a `for..of` loop we found 5 of them, then decided it's enough and made a `break`. Then the engine won't spend time finding other 95 matches.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Named groups
|
## Named groups
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue