- 出版社: O'Reilly Media, Inc, USA; 2nd Revised edition (2012年8月28日)
- 平装: 520页
- 语种： 英语
- ISBN: 1449319432
- 条形码: 9781449319434
- 商品尺寸: 17.8 x 3.3 x 23.3 cm
- 商品重量: 943 g
- ASIN: 1449319432
- 用户评分: 1 条商品评论
- 亚马逊热销商品排名: 图书商品里排第2,080,073名 (查看图书商品销售排行榜)
Regular Expressions Cookbook (英语) 平装 – 2012年8月28日
The range of examples is broad - in a good sense. Most of them are practical, real-world applications for most programmers, so understanding what they're trying to accomplish really helped in understanding the "how" of the implementation.
I've never needed most of these recipes. I'm not a sysadmin - I work with natural-language processing primarily.
If you don't know whether you need this, just use StackOverflow.
The last great book on Regular Expressions was "Mastering Regular Expressions" by Jeffrey E. F. Friedl, also published by O'Reilly. This book does not replace "Mastering Regular Expressions", but complements it. Between the two volumes, you'll know everything of importance worth knowing about Regular Expressions and their use.
Regular Expressions are used to find specific patterns of text. For anyone working extensively with text of any kind, Regular Expressions are as necessary as water and air to sustaining human life. Most people never get behind the primitive search functions of their word processor or spreadsheet program. Too bad: they're missing a lot.
The ugly part of what they're missing is learning how to use Regular Expressions.
Conceptually, Regular Expressions are difficult for many people (like me) to grasp and even more difficult to learn. A big part of that is the staggering power of Regular Expressions ("regexp" or "regexes"). Want to a single search for specific words that are misspelled? Regex. How about sentences beginning or ending with specific words? Use a regex.
In their cookbook, the authors demonstrate more than a hundred examples. Better yet, they do it in seven common regex flavors. The authors claim "Regular Expressions Cookbook" is all you know to learn how to use Regular Expressions. They do start with the basics, but I question whether this book is all most will need. I think consulting one of the many fine Regular Expression tutorials on the web might be a helpful first step for the utter novice.
The cookbook itself is absolutely marvelous.
There are more than one hundred recipes, beginning with matching literal text; advancing through matching previously matched text again; retrieving a list of all matches; validating formats of things like email addresses, international phone numbers, even European VAT numbers; finding words not preceded or followed by a specific word; and much more.
This is, I short, a book for the true geek to curl up with and read. You may not need the information now, but you will need it someday and just browsing is an effective way to pick it up. Likewise, if you're looking for an immediate solution to a problem right now, just check the Table Of Contents. Odds are you'll find what you're looking for or something real close. Sadly, however, the index isn't very good.
In short, this is the newest benchmark reference for Regular Expressions. With this and "Mastering Regular Expressions", you are going to be a Master of the Universe and do things with text that will leave ordinary mortals awestruck.