Chapter 11. REGULAR EXPRESSION GRAPHER

Regular expressions are among Perl's most powerful features. But they are also the most cryptic. After all, it's hard at first glance to tell what /\s*(\S+)(\d+)/ really means. But it turns out that the regular expression matcher is a simple state machine whose input and processing can easily be represented graphically, as shown.

From this you can see that the regular expression consists of three major parts (excluding the start and end nodes) and that it stores results into $1 and $2. We'll go into what all those lines and symbols mean later, but this example shows how something complex and cryptic can ...

Get Wicked Cool Perl Scripts 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.