--- id: 587d7db4367417b2b2512b92 title: Extract Matches challengeType: 1 videoUrl: '' localeTitle: Экстракционные матчи --- ## Description
До сих пор вы проверяли, существует ли шаблон в строке или нет. Вы также можете извлечь фактические совпадения, найденные с помощью .match() . Чтобы использовать метод .match() , примените метод к строке и передайте в регулярное выражение внутри круглых скобок. Вот пример:
«Hello, World!». Match (/ Hello /);
// Возвращает ["Hello"]
let ourStr = "Регулярные выражения";
пусть нашRegex = / выражения /;
ourStr.match (ourRegex);
// Возвращает ["выражения"]
## Instructions
Нанести .match() метод , чтобы извлечь слово coding .
## Tests
```yml tests: - text: result должен иметь слово coding testString: 'assert(result.join() === "coding", "The result should have the word coding");' - text: '' testString: 'assert(codingRegex.source === "coding", "Your regex codingRegex should search for coding");' - text: '' testString: 'assert(code.match(/\.match\(.*\)/), "You should use the .match() method.");' ```
## Challenge Seed
```js let extractStr = "Extract the word 'coding' from this string."; let codingRegex = /change/; // Change this line let result = extractStr; // Change this line ```
## Solution
```js // solution required ```