← Winnitude! Search  ·  Reader Mode (2427 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 78 LINKS

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


All committers have signed the CLA.

dolgachio requested changes Oct 21, 2022
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 .

Дякую, за чудовий переклад! Вибачаюсь, що вам довелося так довго чекати :)
Подивіться, будь ласка, мої коментарі і напишіть мені, якщо з чимось не згодні.

Comment thread 9-regular-expressions/13-regexp-alternation/article.md
Outdated
# Альтернація (АБО ) |

Alternation is the term in regular expression that is actually a simple "OR ".
Альтернація - це термін у регулярному виразі, який насправді є простим "АБО ".
Comment thread 9-regular-expressions/13-regexp-alternation/article.md
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`.
Comment thread 9-regular-expressions/13-regexp-alternation/article.md
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`.
Для того, щоб використати альтернацію до обраної частини шаблону, ми можемо загорнути його у дужки :
Comment thread 9-regular-expressions/13-regexp-alternation/article.md
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 хвилин підходять до шаблону, однак цей час не є вірним ).
Comment thread 9-regular-expressions/13-regexp-alternation/article.md
Outdated
- ( no other first digit is allowed )
- Якщо перша цифра `0` або `1`, тоді наступна може бути будь-якою цифрою : `pattern:[01]\d`.
- В іншому випадку, якщо перша цифра `2`, тоді наступна має бути від 0 до 3 `pattern:[0-3]`.
- ( іншої першої цифри не може бути )
Comment thread 9-regular-expressions/13-regexp-alternation/02-find-matching-bbtags/task.md
Outdated

```js
let regexp = / your regexp/flags ;
let regexp = / ваш регулярний вираз/прапорець ;
Comment thread 9-regular-expressions/13-regexp-alternation/02-find-matching-bbtags/task.md
Outdated
```

If tags are nested, then we need the outer tag (if we want we can continue the search in its content ):
Якщо теки вкладені, тоді необхідно шукати зовнішній тег (за бажанням, можна продовжити пошук всередині його вмісту ):
Comment thread 9-regular-expressions/13-regexp-alternation/02-find-matching-bbtags/task.md
Outdated

```js
let regexp = / your regexp/flags ;
let regexp = / ваш регулярний вираз/прапорець ;
Comment thread 9-regular-expressions/13-regexp-alternation/03-match-quoted-string/solution.md
Outdated
@@ -1,17 +1,17 @@
The solution : `pattern:/"(\\.|[^"\\])*"/g`.
Вирішення : `pattern:/"(\\.|[^"\\])*"/g`.
Comment thread 9-regular-expressions/13-regexp-alternation/03-match-quoted-string/task.md
Outdated
Тому нам необхідно шукати від одних лапок до інших, ігноруючи екрановані лапки на нашому шляху .

That's the essential part of the task, otherwise it would be trivial .
У цьому і полягає основна складність завдання, адже без цієї умови - вирішення було б елементарним .
javascript-translate-bot added changes requested and removed review needed labels Oct 21, 2022

javascript-translate-bot commented Oct 21, 2022



Copy link Copy Markdown
Contributor

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

Corrected the translation after review 4610c8b

vladiuskor commented Oct 23, 2022



Copy link Copy Markdown
Contributor

Author

/done

javascript-translate-bot added review needed and removed changes requested labels Oct 23, 2022

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

allcontributors
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 ! 🎉

dolgachio approved these changes Oct 24, 2022
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

Labels

needs +1

4 participants