Skip to content

Capturing groups - #441

Merged
dolgachio merged 2 commits into
javascript-tutorial:masterfrom
SamGreenberg:capturing-groups
Mar 25, 2023
Merged

dolgachio merged 2 commits into
javascript-tutorial:masterfrom
SamGreenberg:capturing-groups

Conversation

@SamGreenberg

Copy link
Copy Markdown
Contributor

No description provided.

@dolgachio dolgachio left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Π”ΡΠΊΡƒΡŽ Π·Π° ΠΏΠ΅Ρ€Π΅ΠΊΠ»Π°Π΄ Ρ– ваш внСсок! Π― Π΄ΠΎΠ΄Π°Π² ΠΊΡ–Π»ΡŒΠΊΠ° ΠΊΠΎΠΌΠ΅Π½Ρ‚Π°Ρ€Ρ–Π² Π΄ΠΎ тСксту, Π· вашого Π±ΠΎΠΊΡƒ Π½Ρ–Ρ‡ΠΎΠ³ΠΎ Π±Ρ–Π»ΡŒΡˆΠ΅ Π½Π΅ Ρ‚Ρ€Π΅Π±Π°, я сам внСсу Π½Π΅ΠΎΠ±Ρ…Ρ–Π΄Π½Ρ– Π·ΠΌΡ–Π½ΠΈ


```js run
let str = "Gogogo John!";
let str = "Gogogo Π†Π²Π°Π½!";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let str = "Gogogo Π†Π²Π°Π½!";
let str = "Gogogo John!";

alert( result[0] ); // Gogogo John (full match)
alert( result[1] ); // John
alert( result.length ); // 2 (no more items in the array)
alert( result[0] ); // Gogogo Π†Π²Π°Π½ (ΠΏΠΎΠ²Π½ΠΈΠΉ Π·Π±Ρ–Π³)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
alert( result[0] ); // Gogogo Π†Π²Π°Π½ (ΠΏΠΎΠ²Π½ΠΈΠΉ Π·Π±Ρ–Π³)
alert( result[0] ); // Gogogo John (ΠΏΠΎΠ²Π½ΠΈΠΉ Π·Π±Ρ–Π³)

alert( result[1] ); // John
alert( result.length ); // 2 (no more items in the array)
alert( result[0] ); // Gogogo Π†Π²Π°Π½ (ΠΏΠΎΠ²Π½ΠΈΠΉ Π·Π±Ρ–Π³)
alert( result[1] ); // Π†Π²Π°Π½

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
alert( result[1] ); // Π†Π²Π°Π½
alert( result[1] ); // John

alert( result.length ); // 2 (no more items in the array)
alert( result[0] ); // Gogogo Π†Π²Π°Π½ (ΠΏΠΎΠ²Π½ΠΈΠΉ Π·Π±Ρ–Π³)
alert( result[1] ); // Π†Π²Π°Π½
alert( result.length ); // 2 (Ρ–Π½ΡˆΠΈΡ… Π΅Π»Π΅ΠΌΠ΅Π½Ρ‚Ρ–Π² Ρƒ масиві Π½Π΅ΠΌΠ°)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
alert( result.length ); // 2 (Ρ–Π½ΡˆΠΈΡ… Π΅Π»Π΅ΠΌΠ΅Π½Ρ‚Ρ–Π² Ρƒ масиві Π½Π΅ΠΌΠ°)
alert( result.length ); // 2 (Ρ–Π½ΡˆΠΈΡ… Π΅Π»Π΅ΠΌΠ΅Π½Ρ‚Ρ–Π² Ρƒ масиві Π½Π΅ΠΌΠ°Ρ”)


- The method `str.match` returns capturing groups only without flag `pattern:g`.
- The method `str.matchAll` always returns capturing groups.
- ΠœΠ΅Ρ‚ΠΎΠ΄ `str.match` ΠΏΠΎΠ²Π΅Ρ€Ρ‚Π°Ρ” Π³Ρ€ΡƒΠΏΠΈ захоплСння лишС Π±Π΅Π· ΠΏΡ€Π°ΠΏΠΎΡ€Ρƒ `pattern:g`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- ΠœΠ΅Ρ‚ΠΎΠ΄ `str.match` ΠΏΠΎΠ²Π΅Ρ€Ρ‚Π°Ρ” Π³Ρ€ΡƒΠΏΠΈ захоплСння лишС Π±Π΅Π· ΠΏΡ€Π°ΠΏΠΎΡ€Ρƒ `pattern:g`.
- ΠœΠ΅Ρ‚ΠΎΠ΄ `str.match` ΠΏΠΎΠ²Π΅Ρ€Ρ‚Π°Ρ” Π³Ρ€ΡƒΠΏΠΈ захоплСння лишС Π±Π΅Π· ΠΏΡ€Π°ΠΏΠΎΡ€Ρ†ΡŽ `pattern:g`.

@javascript-translate-bot

Copy link
Copy Markdown
Contributor

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review πŸ‘»

@dolgachio

Copy link
Copy Markdown
Collaborator

@all-contributors add @SamGreenberg for translation

@allcontributors

Copy link
Copy Markdown
Contributor

@stas-dolgachov

@SamGreenberg already contributed before to translation

@dolgachio
dolgachio merged commit 0dc4838 into javascript-tutorial:master Mar 25, 2023
@javascript-translate-bot

Copy link
Copy Markdown
Contributor

Thank you πŸ’– I updated the Progress Issue #1 πŸŽ‰ πŸŽ‰ πŸŽ‰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants