Link Search Menu Expand Document

Extract Matches

Summary

  • The .match() method is used to return the matches of a search.

Final Code

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