Lesson

Match Anything with Wildcard Period, freeCodeCamp's Regex Tutorials 2020, Learn Regular Expressions

Lesson Summary

In our continuation on our road to regex mastery, we are now embarking on a knowledge quest that will teach us the power of the wildcard. The wildcard allows us to ignore characters before or after a specific pattern we are searching for. For example, if we wanted to find all words that start with "a", we can use a wildcard to specify all words that start with "a" by using the following regex pattern "/a./" The dot regex syntax says find all "a" patterns regardless of what comes after it. This dot syntax can also be used before the "a", to find all patterns that end with "a". Using the wildcard syntax in combination with an "i" and "g" flag can help us quickly find words that have certain patterns within an enormous body of text, making it a powerful tool to be aware of when learning regular expressions.

Subscribe To Monthly Newsletter. Chance to Win Monthly Prizes

* indicates required


Share: