Summary

Pattern matching and regular expressions are, arguably, Perl's most powerful feature. Whereas other languages might provide regular expression libraries or functions, pattern matching is intrinsic to Perl's operation and tightly bound to many other aspects of the language. Perl without regular expressions is just another funny-looking language. Perl with regular expressions is incredibly useful.

Today you learned all about patterns: building them, using them, saving bits of them, and putting them together with other parts of Perl. You learned about the various metacharacters you can use inside regular expressions: metacharacters for anchoring a pattern (^, $, \B, \b), for creating a character class ([] and [^]), for alternating between ...

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.