-
Notifications
You must be signed in to change notification settings - Fork 183
Sets and ranges [...] #421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dolgachio
merged 25 commits into
javascript-tutorial:master
from
MrsMelnychenko:regex-sets
Jan 4, 2023
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
05bb895
Sets and ranges [...]
MrsMelnychenko 4d34435
Merge branch 'javascript-tutorial:master' into regex-sets
MrsMelnychenko a38fb86
Update 9-regular-expressions/08-regexp-character-sets-and-ranges/arti…
MrsMelnychenko a298167
Update 9-regular-expressions/08-regexp-character-sets-and-ranges/arti…
MrsMelnychenko be0ffd7
Update 9-regular-expressions/08-regexp-character-sets-and-ranges/arti…
MrsMelnychenko e0510a8
Update 9-regular-expressions/08-regexp-character-sets-and-ranges/arti…
MrsMelnychenko e871532
Update 9-regular-expressions/08-regexp-character-sets-and-ranges/arti…
MrsMelnychenko 1206829
Update 9-regular-expressions/08-regexp-character-sets-and-ranges/arti…
MrsMelnychenko 579dc3b
Update 9-regular-expressions/08-regexp-character-sets-and-ranges/arti…
MrsMelnychenko 8f67d1d
Update 9-regular-expressions/08-regexp-character-sets-and-ranges/arti…
MrsMelnychenko aeeda3a
Update 9-regular-expressions/08-regexp-character-sets-and-ranges/arti…
MrsMelnychenko 600e01f
Update 9-regular-expressions/08-regexp-character-sets-and-ranges/arti…
MrsMelnychenko c02a730
Update solution.md
MrsMelnychenko d518988
Update solution.md
MrsMelnychenko b5ee3bd
Update solution.md
MrsMelnychenko a519a46
Update task.md
MrsMelnychenko fb140a8
Update solution.md
MrsMelnychenko aded3d3
Update task.md
MrsMelnychenko fb5e78b
Update task.md
MrsMelnychenko cf8bba9
Update solution.md
MrsMelnychenko a44dbbf
Update task.md
MrsMelnychenko 67f9e71
Update task.md
MrsMelnychenko 7f5a6e0
Update solution.md
MrsMelnychenko f7c1581
Apply suggestions from code review
dolgachio 4643079
Apply suggestions from code review
dolgachio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
...ular-expressions/08-regexp-character-sets-and-ranges/1-find-range-1/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
9-regular-expressions/08-regexp-character-sets-and-ranges/1-find-range-1/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Java[^script] | ||
|
||
We have a regexp `pattern:/Java[^script]/`. | ||
У нас є регулярний вираз `pattern:/Java[^script]/`. | ||
|
||
Does it match anything in the string `subject:Java`? In the string `subject:JavaScript`? | ||
Чи знайде він співпадіння у рядку `subject:Java`? А у рядку `subject:JavaScript`? |
6 changes: 3 additions & 3 deletions
6
...pressions/08-regexp-character-sets-and-ranges/2-find-time-2-formats/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
Answer: `pattern:\d\d[-:]\d\d`. | ||
Відповідь: `pattern:\d\d[-:]\d\d`. | ||
|
||
```js run | ||
let regexp = /\d\d[-:]\d\d/g; | ||
alert( "Breakfast at 09:00. Dinner at 21-30".match(regexp) ); // 09:00, 21-30 | ||
alert( "Сніданок о 09:00. Вечеря о 21-30".match(regexp) ); // 09:00, 21-30 | ||
``` | ||
|
||
Please note that the dash `pattern:'-'` has a special meaning in square brackets, but only between other characters, not when it's in the beginning or at the end, so we don't need to escape it. | ||
Зверніть увагу, що риска `pattern:'-'` має спеціальне значення у квадратних дужках але тільки між іншими символами, не на початку чи в кінці виразу, тож немає необхідності її екранувати. |
10 changes: 5 additions & 5 deletions
10
...r-expressions/08-regexp-character-sets-and-ranges/2-find-time-2-formats/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# Find the time as hh:mm or hh-mm | ||
# Знайдіть часовий формат hh:mm або hh-mm | ||
|
||
The time can be in the format `hours:minutes` or `hours-minutes`. Both hours and minutes have 2 digits: `09:00` or `21-30`. | ||
Час можна записати у форматі `години:хвилини` або `години-хвилини`. У будь-якому разі потрібні дві цифри для позначення годин і хвилин: `09:00` або `21-30`. | ||
|
||
Write a regexp to find time: | ||
Напишіть регулярний вираз для пошуку часового формату: | ||
|
||
```js | ||
let regexp = /your regexp/g; | ||
alert( "Breakfast at 09:00. Dinner at 21-30".match(regexp) ); // 09:00, 21-30 | ||
alert( "Сніданок о 09:00. Вечеря о 21-30".match(regexp) ); // 09:00, 21-30 | ||
``` | ||
|
||
P.S. In this task we assume that the time is always correct, there's no need to filter out bad strings like "45:67". Later we'll deal with that too. | ||
P.S. В цій задачі ми завжди маємо коректний час, не потрібно перевіряти неіснуючі комбінації цифр, як-то "45:67". Пізніше ми роглянемо і такі випадки. |
170 changes: 85 additions & 85 deletions
170
9-regular-expressions/08-regexp-character-sets-and-ranges/article.md
Large diffs are not rendered by default.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
9-regular-expressions/09-regexp-quantifiers/1-find-text-manydots/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
|
||
Solution: | ||
Відповідь: | ||
|
||
```js run | ||
let regexp = /\.{3,}/g; | ||
alert( "Hello!... How goes?.....".match(regexp) ); // ..., ..... | ||
alert( "Привіт!... Як справи?.....".match(regexp) ); // ..., ..... | ||
``` | ||
|
||
Please note that the dot is a special character, so we have to escape it and insert as `\.`. | ||
Зауважте, що крапка це спецсимвол, тож потребує екранування за допомогою `\.`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
9-regular-expressions/09-regexp-quantifiers/2-find-html-colors-6hex/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Regexp for HTML colors | ||
# Регулярний вираз для кольорів в HTML | ||
|
||
Create a regexp to search HTML-colors written as `#ABCDEF`: first `#` and then 6 hexadecimal characters. | ||
Створіть регулярний вираз, який шукає HTML-кольори записані у форматі `#ABCDEF`: спершу символ `#` за яким слідують 6 шістнадцяткових символів. | ||
|
||
An example of use: | ||
Приклад використання: | ||
|
||
```js | ||
let regexp = /...your regexp.../ | ||
let regexp = /...ваш регулярний вираз.../ | ||
|
||
let str = "color:#121212; background-color:#AA00ef bad-colors:f#fddee #fd2 #12345678"; | ||
|
||
alert( str.match(regexp) ) // #121212,#AA00ef | ||
``` | ||
|
||
P.S. In this task we do not need other color formats like `#123` or `rgb(1,2,3)` etc. | ||
P.S. В цій задачі нам не потрібно враховувати інші формати запису кольорів, як наприклад `#123` або `rgb(1,2,3)` тощо. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.