Repository navigation
Capturing groups - #441
Capturing groups#441
Conversation
dolgachio
left a comment
There was a problem hiding this comment.
ΠΡΠΊΡΡ Π·Π° ΠΏΠ΅ΡΠ΅ΠΊΠ»Π°Π΄ Ρ Π²Π°Ρ Π²Π½Π΅ΡΠΎΠΊ! Π― Π΄ΠΎΠ΄Π°Π² ΠΊΡΠ»ΡΠΊΠ° ΠΊΠΎΠΌΠ΅Π½ΡΠ°ΡΡΠ² Π΄ΠΎ ΡΠ΅ΠΊΡΡΡ, Π· Π²Π°ΡΠΎΠ³ΠΎ Π±ΠΎΠΊΡ Π½ΡΡΠΎΠ³ΠΎ Π±ΡΠ»ΡΡΠ΅ Π½Π΅ ΡΡΠ΅Π±Π°, Ρ ΡΠ°ΠΌ Π²Π½Π΅ΡΡ Π½Π΅ΠΎΠ±Ρ ΡΠ΄Π½Ρ Π·ΠΌΡΠ½ΠΈ
|
|
||
| ```js run | ||
| let str = "Gogogo John!"; | ||
| let str = "Gogogo ΠΠ²Π°Π½!"; |
There was a problem hiding this comment.
| 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 ΠΠ²Π°Π½ (ΠΏΠΎΠ²Π½ΠΈΠΉ Π·Π±ΡΠ³) |
There was a problem hiding this comment.
| 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] ); // ΠΠ²Π°Π½ |
There was a problem hiding this comment.
| 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 (ΡΠ½ΡΠΈΡ Π΅Π»Π΅ΠΌΠ΅Π½ΡΡΠ² Ρ ΠΌΠ°ΡΠΈΠ²Ρ Π½Π΅ΠΌΠ°) |
There was a problem hiding this comment.
| 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`. |
There was a problem hiding this comment.
| - ΠΠ΅ΡΠΎΠ΄ `str.match` ΠΏΠΎΠ²Π΅ΡΡΠ°Ρ Π³ΡΡΠΏΠΈ Π·Π°Ρ ΠΎΠΏΠ»Π΅Π½Π½Ρ Π»ΠΈΡΠ΅ Π±Π΅Π· ΠΏΡΠ°ΠΏΠΎΡΡ `pattern:g`. | |
| - ΠΠ΅ΡΠΎΠ΄ `str.match` ΠΏΠΎΠ²Π΅ΡΡΠ°Ρ Π³ΡΡΠΏΠΈ Π·Π°Ρ ΠΎΠΏΠ»Π΅Π½Π½Ρ Π»ΠΈΡΠ΅ Π±Π΅Π· ΠΏΡΠ°ΠΏΠΎΡΡΡ `pattern:g`. |
|
Please make the requested changes. After it, add a comment "/done". |
|
@all-contributors add @SamGreenberg for translation |
|
@stas-dolgachov @SamGreenberg already contributed before to translation |
|
Thank you π I updated the Progress Issue #1 π π π |
No description provided.