Extract Matches1

Tell us what’s happening:

WHERE IS WRONG?

Your code so far


let extractStr = "Extract the word 'coding' from this string.";
let codingRegex = /change/; // Change this line
myStr.match(codingRegex); // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/extract-matches

The word is not /change/, it is /coding/.

myStr is not defined
myStr is not defined
myStr is not defined

I changed it but tell that above this line.

Also you need to apply the match function to extractStr and not to mystr which isn’t defined, like this:

extractStr.match(codingRegex);

I do it but again tell me that:
result is not defined

And my code is:
let extractStr = “Extract the word ‘coding’ from this string.”;
let codingRegex = /coding/; // Change this line
extractStr.match(codingRegex); // Change this line

When you see this, that means you have attempted to use a variable which has not been declared in your code.

The original code had a variable declared named result. Put that declaration back in.

Assign extractStr.match(codingRegex) to result:

let result = extractStr.match(codingRegex);

Yeeesss thank you this isn’t so hard:grinning::grinning:

That’s right! :grinning::+1: