Perl Regular Expression Mastery | Search for a title, author or keyword | ||||||||
Perl Regular Expression Mastery By Mark-Jason Dominus, 2003. Regex ( Regular Expressions ) matching is like a machine running a program. The machine is very simple, and always does the same thing. The regex is the program, and varies the machine's behavior a little. To understand regexes, you need to understand the machine. The machine is called the Regex Engine. Almost everyone has written a regex that failed to match something they wanted it to, or that matched something they thought it shouldn't, and often it can be hard to predict what a regex will do. This class will fix that. The first section will explore the algorithm that perl uses internally to do regex matching: Backtracking, Quantifiers, Greed, Anti-greed, Anchors and assertions, Backreferences. Understanding this algorithm will allow us to predict whether a regex will match, which of several matches Perl will find, and which regexes will be faster than others. In the second section, we'll apply our knowledge of the internals, examining at several common disasters, a few practical parsing applications, and some new features such that would have been hard to understand before.
|
|||||||||
Perl Regular Expression Mastery | Disclaimer: this link points to content provided by other sites. |