Match a Literal String with Different Possibilities, Learn Regexes on freeCodeCamp, Understanding JS

Lesson Summary

In this lesson, we continue learning about matching patterns using regular expressions in javascript. JS regular expressions allow us to match all types of patterns. It is what makes the magic of search engines so powerful as well as searching and extracting valuable information from huge datasets and text files. In this lesson, we learn how to look for multiple patterns within text. We are able to do this using the regular expression "OR" operator. This is similar to the "OR" operator we use in conditional statements except instead of 2 bars, we only use a single bar. We separate each pattern by a single bar in order to be able to search for multiple patterns within a string of text. Understanding the "OR" 'regular expressions operator is helpful when looking for multiple patterns within a string of text.

Subscribe To Monthly Newsletter. Chance to Win Monthly Prizes

* indicates required