Match Ending String Patterns Using Regexes, Regex Pattern Matching Tutorial, freeCodeCamp Coding Ex

Lesson Summary

In this lesson from freeCodeCamp's Regular Expression course we continue learning regex syntax that we can use to match specific patterns. In this lesson we specifically learn how to match the end of a string pattern. We learn that we are able to do this using the dollar sign character at the end of our regex pattern. For example, if we wanted to know whether the word "caboose" appeared at the end of a string we could create the following regex to test against a string, "/caboose$/" If we applied this particular regex expression to a string that ended with the word "caboose", our regex would return true if we tested it.

Subscribe To Monthly Newsletter. Chance to Win Monthly Prizes

* indicates required