Skip to content

Commit b189e22

Browse files
authored
Update article.md
1 parent 7e8cf03 commit b189e22

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

9-regular-expressions/09-regexp-groups/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ alert(result); // <span class="my">, span class="my", span, class="my"
105105

106106
![](regexp-nested-groups.png)
107107

108-
At the zero index of the `result` is always the full match.
108+
С нулевым индексом `result` всегда идет совпадение полностью.
109109

110-
Then groups, numbered from left to right. Whichever opens first gives the first group `result[1]`. Here it encloses the whole tag content.
110+
Затем группы, нумеруемые слева направо. Та, которая открывается первой, получает первую группу `result[1]`. Она заключает в себе все содержимое тега.
111111

112-
Then in `result[2]` goes the group from the second opening `pattern:(` till the corresponding `pattern:)` -- tag name, then we don't group spaces, but group attributes for `result[3]`.
112+
Затем в `result[2]` идет группа от второй открывающей скобки `pattern:(` до соответствующей `pattern:)` -- имя тега, тогда мы группируем не пространства, а группу аттрибутов для `result[3]`.
113113

114-
**If a group is optional and doesn't exist in the match, the corresponding `result` index is present (and equals `undefined`).**
114+
**Даже если скобочная группа необязательна и не входит в совпадение, соответствующий элемент массива `result` существует (и равен `undefined`).**
115115

116116
For instance, let's consider the regexp `pattern:a(z)?(c)?`. It looks for `"a"` optionally followed by `"z"` optionally followed by `"c"`.
117117

0 commit comments

Comments
 (0)