File tree Expand file tree Collapse file tree
9-regular-expressions/09-regexp-groups/1-find-webcolor-3-or-6 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # Find color in the format #abc or #abcdef
1+ # Найти цвет в формате #abc или #abcdef
22
3- Write a RegExp that matches colors in the format ` #abc ` or ` #abcdef ` . That is : ` # ` followed by 3 or 6 hexadecimal digits .
3+ Напишите регэксп, который соответствует цветам в формате ` #abc ` или ` #abcdef ` . То есть : ` # ` и за ним 3 или 6 шестнадцатеричных цифры .
44
5- Usage example :
5+ Пример использования :
66``` js
7- let reg = / your regexp / g ;
7+ let reg = / ваш регэксп / g ;
88
99let str = " color: #3f3; background-color: #AA00ef; and: #abcd" ;
1010
1111alert ( str .match (reg) ); // #3f3 #AA00ef
1212```
1313
14- P.S. This should be exactly 3 or 6 hex digits: values like ` # abcd` should not match .
14+ P.S. Это должно быть ровно 3 или 6 шестнадцатеричных цифры, такие как " abcd" не должны совпадать .
You can’t perform that action at this time.
0 commit comments