--- id: 587d7db4367417b2b2512b92 title: Extract Matches challengeType: 1 videoUrl: '' localeTitle: Extraer fósforos --- ## Description
Hasta ahora, solo has estado comprobando si un patrón existe o no dentro de una cadena. También puede extraer las coincidencias reales que encontró con el método .match() . Para usar el método .match() , aplique el método en una cadena y pase la expresión regular dentro de los paréntesis. Aquí hay un ejemplo:
"¡Hola, mundo!". Match (/ Hello /);
// Devoluciones ["Hola"]
deja ourStr = "expresiones regulares";
vamos a nuestroRegex = / expresiones /;
ourStr.match (ourRegex);
// Devoluciones ["expresiones"]
## Instructions
Aplique el método .match() para extraer la coding palabras.
## Tests
```yml tests: - text: El result debe tener la palabra coding testString: 'assert(result.join() === "coding", "The result should have the word coding");' - text: Tu regex codingRegex debería buscar la coding testString: 'assert(codingRegex.source === "coding", "Your regex codingRegex should search for coding");' - text: Deberías usar el 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 ```