--- id: 587d7db4367417b2b2512b92 title: Extract Matches challengeType: 1 videoUrl: '' localeTitle: Extrair correspondências --- ## Description
Até agora, você só verifica se um padrão existe ou não em uma string. Você também pode extrair as correspondências reais encontradas com o método .match() . Para usar o método .match() , aplique o método em uma string e passe o regex dentro dos parênteses. Aqui está um exemplo:
"Olá, mundo!". Match (/ Hello /);
// Retorna ["Olá"]
vamos ourStr = "Expressões regulares";
vamos ourRegex = / expressões /;
ourStr.match (ourRegex);
// Retorna ["expressões"]
## Instructions
Aplique o método .match() para extrair a coding palavras.
## Tests
```yml tests: - text: O result deve ter a palavra coding testString: 'assert(result.join() === "coding", "The result should have the word coding");' - text: Seu regex codingRegex deve procurar por coding testString: 'assert(codingRegex.source === "coding", "Your regex codingRegex should search for coding");' - text: Você deve usar o método .match() . 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 ```