Skip to content

Commit 6fb018f

Browse files
authored
Merge pull request #583 from MFry/patch-1
Update article.md
2 parents 1889fd8 + 9cda561 commit 6fb018f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

5-regular-expressions/09-regexp-groups/1-find-webcolor-3-or-6/task.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Find color in the format #abc or #abcdef
22

3-
Write a regexp that matches colors in the format `#abc` or `#abcdef`. That is: `#` followed by 3 or 6 hexadimal digits.
3+
Write a RegExp that matches colors in the format `#abc` or `#abcdef`. That is: `#` followed by 3 or 6 hexadecimal digits.
44

55
Usage example:
66
```js
@@ -11,4 +11,4 @@ let str = "color: #3f3; background-color: #AA00ef; and: #abcd";
1111
alert( str.match(reg) ); // #3f3 #AA0ef
1212
```
1313

14-
P.S. Should be exactly 3 or 6 hex digits: values like `#abcd` should not match.
14+
P.S. This should be exactly 3 or 6 hex digits: values like `#abcd` should not match.

5-regular-expressions/09-regexp-groups/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Capturing groups
22

3-
A part of the pattern can be enclosed in parentheses `pattern:(...)`. That's called a "capturing group".
3+
A part of a pattern can be enclosed in parentheses `pattern:(...)`. This is called a "capturing group".
44

55
That has two effects:
66

@@ -30,9 +30,9 @@ [email protected]
3030

3131
The pattern: `pattern:[-.\w]+@([\w-]+\.)+[\w-]{2,20}`.
3232

33-
- The first part before `@` may include wordly characters, a dot and a dash `pattern:[-.\w]+`, like `match:john.smith`.
33+
- The first part before `@` may include any alphanumeric word characters, a dot and a dash `pattern:[-.\w]+`, like `match:john.smith`.
3434
- Then `pattern:@`
35-
- And then the domain. May be a second-level domain `site.com` or with subdomains like `host.site.com.uk`. We can match it as "a word followed by a dot" repeated one or more times for subdomains: `match:mail.` or `match:site.com.`, and then "a word" for the last part: `match:.com` or `match:.uk`.
35+
- And then the domain and maybe a second-level domain like `site.com` or with subdomains like `host.site.com.uk`. We can match it as "a word followed by a dot" repeated one or more times for subdomains: `match:mail.` or `match:site.com.`, and then "a word" for the last part: `match:.com` or `match:.uk`.
3636

3737
The word followed by a dot is `pattern:(\w+\.)+` (repeated). The last word should not have a dot at the end, so it's just `\w{2,20}`. The quantifier `pattern:{2,20}` limits the length, because domain zones are like `.uk` or `.com` or `.museum`, but can't be longer than 20 characters.
3838

0 commit comments

Comments
 (0)