14.01.2013 Views

Mastering Regular Expressions - Table of Contents

Mastering Regular Expressions - Table of Contents

Mastering Regular Expressions - Table of Contents

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Page 85<br />

happens is different for most tools. awk, lex, and egrep are among the few tools<br />

for which it would actually be identical this is the topic <strong>of</strong> Chapter 4. Even if it<br />

were exactly the same, it could be useful for its notational convenience or clarity.<br />

As Larry Wall explained to me once, "It's like having a zero in your numbering<br />

system."<br />

Guide to the Advanced Chapters<br />

Now that we're familiar with metacharacters, flavors, syntactic packaging, and the<br />

like, it's time to start getting into the nitty-gritty details, the meat <strong>of</strong> the subject,<br />

the "hard core," if you will. This begins in Chapter 4, The Mechanics <strong>of</strong><br />

Expression Processing. There are different ways a tool's match engine might be<br />

implemented, and the selection influences if a match is achieved or not, which text<br />

in the string gets matched, and how much time the whole thing takes. We'll look at<br />

all the details. As a byproduct <strong>of</strong> this knowledge, it will become much easier for<br />

you to craft complex expressions with confidence.<br />

This brings us to Chapter 5, Crafting a <strong>Regular</strong> Expression. Once you know the<br />

basics about how an engine works, you can consider techniques to take full<br />

advantage <strong>of</strong> that knowledge and <strong>of</strong> the engine. Chapter 5 looks at some <strong>of</strong> the<br />

pitfalls <strong>of</strong> certain popular regex flavors pitfalls that <strong>of</strong>ten lead to unwelcome<br />

surprises and turns the tables to put them to use for us.<br />

Chapters 4 and 5 are the central core <strong>of</strong> this book, its essence. These first three<br />

chapters merely lead up to them, and the discussions in the tool-specific chapters<br />

that follow rely on them. It's not necessarily what you would call light reading,<br />

but I've taken great care to stay away from math and algebra and all that stuff<br />

that's just mumbo-jumbo to most <strong>of</strong> us. As with any large amount <strong>of</strong> new<br />

information, it will likely take time to sink in and internalize.<br />

Tool-Specific Information<br />

The lessons and techniques discussed in Chapters 4 and 5 transcend any particular<br />

tool. You might need to cosmetically adjust the examples to fit a certain flavor,<br />

but it's the lessons that are important, not the examples.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!