We aren't just limited to writing our regex
if statements in the manner of the last lesson. Instead, we can use any type of named capturing group alongside our statement; this is especially useful when we want to include multiple match options in our
if statements. We can do that by nesting
if statements within the
else portion of the regex. In this lesson, we expand on our prior statement to use named grouping for clarity and pull more information from our file.
Get the lesson files here!: