Regular Expressions - Extract Matches

Tell us what’s happening:
Whats the real world application of this.

Your code so far

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0

Challenge: Regular Expressions - Extract Matches

Link to the challenge:

If you wanted to validate a string had a specific grouping of characters in it. There are many applications when something like this is needed. There are other ways of validating such a thing, but the challenge just wants to make sure you understand how to use match to do it.

1 Like