Extract Matches Using Regex, freeCodeCamp Regular Expression Help, Learn Regexes

Lesson Summary

In this video, we finally learn how to return matched patterns. In the last lessons, we have learned how to test a string to see if a pattern is found. We use the test method which returns true or false depending on if the pattern is found. But up until now, we have not been able to return the matched results. In this lesson concerning regexes, we look at extracting the instances our pattern is found. We are able to do this using the match method. The .match method returns every instance of the pattern within a string.

Subscribe To Monthly Newsletter. Chance to Win Monthly Prizes

* indicates required