Up until this point, we've focused on translating each part of our matches one at a time into the best general option, whether that be metacharacter or literal. But regular expressions are limited to one-to-one matches. Alternation allows us to provide regex options for what we want a token to match. In this lesson, we learn how to use the vertical bar (
|) metacharacter to tell our regex engine when we want it to consider multiple matches.
Get the lesson files here!: