Tell us what’s happening:
As far as my understanding of this goes
in the above line we place the word we need thats coding
then use the .match to call the line that is matched to it
in case the: extractStr since it contains the word code
yet when i try this it doesn’t work why?
Your code so far
let extractStr = "Extract the word 'coding' from this string.";
let codingRegex = /coding/; // Change this line
let result = extractStr.match(extractStr); // Change this line
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Safari/605.1.15
.
Challenge: Extract Matches
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/regular-expressions/extract-matches