Summary

In today's lesson, you learned more about using regular expressions, building on the basics you learned about yesterday. Today, we talked about extracting matches from a pattern-matching operation using parentheses, and using backreferences and match variables to save matches and refer back to them later.

As part of that discussion, you also learned about pattern matching in different contexts (scalar contexts return true or false, lists return lists of matches), about the greedy behavior of the quantifier metacharacters, and more about the split function. If you made it this far, through both these lessons, you now know enough about regular expressions to match just about any pattern in any set of data.

Get Sams Teach Yourself Perl in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.