Sun 26 Apr 2015
原文
Having opened this cookbook, you are probably eager to inject some of the ungainly strings of parentheses and question marks you find in its chapters right into your code. If you are ready to plug and play, be our guest: the practical regular expressions are listed and described in Chapters 4 through 9.
But the initial chapters of this book may save you a lot of time in the long run. For instance, this chapter introduces you to a number of utilities-some of them created by the authors, Jan and Steven-that let you test and debug a regular expression before you bury it in code where errors are harder to find. And these initial chapters also show you how to use various features and options of regular expressions to make your life easier, help you understand regular expressions in order to improve their performance, and learn the subtle differences between how regular expressions are handled by different programming languages-and even different versions of your favorite programming language.