Chapter 4. The Mechanics of Expression Processing
The previous chapter started with an analogy between cars and regular expressions.
The bulk of the chapter discussed features, regex flavors, and other "glossy
brochure" issues of regular expressions. This chapter continues with that analogy,
talking about the all-important regular-expression engine, and how it goes about
its work.
Why would you care how it works? As we'll see, there are several types of regex
engines, and the type most commonly used — the type used by Perl, Tcl, Python,
the .NET languages, Ruby, PHP, all Java packages I've seen, and more — works in
such a way that how you craft your expression can influence whether it can match a particular string, where in the string it matches, and how quickly it finds the match or reports the failure. If these issues are important to you, this chapter is for you.
|