Alternation (OR) | by vladiuskor · Pull Request #388 · javascript-tutorial/uk.javascript.info
Repository navigation
Alternation (OR) | - #388
Merged
dolgachio merged 3 commits into javascript-tutorial:master from vladiuskor:master Oct 24, 2022
Merged
Alternation (OR) | #388 dolgachio merged 3 commits into javascript-tutorial:master from vladiuskor:master
Conversation
vladiuskor commented Sep 17, 2022
Copy link Copy Markdown
Contributor
No description provided.
vladiuskor added 2 commits September 17, 2022 22:43
Translated article alternation
aaba2b1
Added correct apostrophe
29e6279
javascript-translate-bot
added
the
review needed
label
Sep 17, 2022
CLAassistant commented Sep 17, 2022 · edited Loading
Copy link Copy Markdown
|
|
View reviewed changes
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 .
Дякую, за чудовий переклад! Вибачаюсь, що вам довелося так довго чекати :)
Подивіться, будь ласка, мої коментарі і напишіть мені, якщо з чимось не згодні.
Outdated
| # Альтернація (АБО ) | | ||
|
|
||
| Alternation is the term in regular expression that is actually a simple "OR ". | ||
| Альтернація - це термін у регулярному виразі, який насправді є простим "АБО ". |
Outdated
|
|
||
| - `pattern:gr(a|e)y` means exactly the same as `pattern:gr[ae]y`. | ||
| - `pattern:gra|ey` means `match:gra` or `match:ey`. | ||
| - `pattern:gr(a|e)y` означає те саме, що і `pattern:gr[ae]y`. |
Outdated
| To apply alternation to a chosen part of the pattern, we can enclose it in parentheses : | ||
| - `pattern: I love HTML|CSS` matches `match: I love HTML` or `match:CSS`. | ||
| - `pattern: I love (HTML|CSS)` matches `match: I love HTML` or `match: I love CSS`. | ||
| Для того, щоб використати альтернацію до обраної частини шаблону, ми можемо загорнути його у дужки : |
Outdated
| ## Приклад: регулярний вираз для часу | ||
|
|
||
| In previous articles there was a task to build a regexp for searching time in the form `hh:mm `, for instance `12:00`. But a simple `pattern:\d\d:\d\d` is too vague. It accepts `25:99` as the time (as 99 minutes match the pattern, but that time is invalid ). | ||
| У попередніх главах було завдання написати регулярний вираз для пошуку часу у форматі `гг:хх `, наприклад `12:00`. Однак простий шаблон `pattern:\d\d:\d\d` недостатньо точний. Він приймає `25:99` як час ( 99 хвилин підходять до шаблону, однак цей час не є вірним ). |
Outdated
| - ( no other first digit is allowed ) | ||
| - Якщо перша цифра `0` або `1`, тоді наступна може бути будь-якою цифрою : `pattern:[01]\d`. | ||
| - В іншому випадку, якщо перша цифра `2`, тоді наступна має бути від 0 до 3 `pattern:[0-3]`. | ||
| - ( іншої першої цифри не може бути ) |
Outdated
|
|
||
| ```js | ||
| let regexp = / your regexp/flags ; | ||
| let regexp = / ваш регулярний вираз/прапорець ; |
Outdated
| ``` | ||
|
|
||
| If tags are nested, then we need the outer tag (if we want we can continue the search in its content ): | ||
| Якщо теки вкладені, тоді необхідно шукати зовнішній тег (за бажанням, можна продовжити пошук всередині його вмісту ): |
Outdated
|
|
||
| ```js | ||
| let regexp = / your regexp/flags ; | ||
| let regexp = / ваш регулярний вираз/прапорець ; |
Outdated
| @@ -1,17 +1,17 @@ | ||
| The solution : `pattern:/"(\\.|[^"\\])*"/g`. | ||
| Вирішення : `pattern:/"(\\.|[^"\\])*"/g`. |
Outdated
| Тому нам необхідно шукати від одних лапок до інших, ігноруючи екрановані лапки на нашому шляху . | ||
|
|
||
| That's the essential part of the task, otherwise it would be trivial . | ||
| У цьому і полягає основна складність завдання, адже без цієї умови - вирішення було б елементарним . |
javascript-translate-bot commented Oct 21, 2022
Copy link Copy Markdown
Contributor
|
Please make the requested changes. After it, add a comment "/done". |
Corrected the translation after review
4610c8b
vladiuskor commented Oct 23, 2022
Copy link Copy Markdown
Contributor
Author
|
/done |
vladiuskor commented Oct 23, 2022
Copy link Copy Markdown
Contributor
Author
Дякую за можливість зробити внесок у розвиток чудового ресурсу для україномовної спільноти. Згідний з усіма правками.) |
dolgachio commented Oct 24, 2022
Copy link Copy Markdown
Collaborator
|
@all-contributors add @vladiuskor for translation |
Bot
mentioned this pull request Oct 24, 2022 docs: add vladiuskor as a contributor for translation #410 Merged
allcontributors
Bot
commented
Oct 24, 2022
Copy link Copy Markdown
Contributor
|
@stas-dolgachov I've put up a pull request to add @vladiuskor ! 🎉 |
View reviewed changes
javascript-translate-bot added needs +1 and removed review needed labels Oct 24, 2022 dolgachio merged commit
3038d34
into
javascript-tutorial : master
Oct 24, 2022
tarasyyyk
mentioned this pull request
Aug 29, 2024
Ukrainian Translation Progress
#1
Open
Sign up for free
to join this conversation on GitHub .
Already have an account?
Sign in to comment