Mastering Regular Expressions

Mastering Regular Expressions
by Jeffrey E.F. Friedl

Mastering Regular Expressions
List Price: $44.99
Our Price: $24.88
You Save: $20.11 (45%)
Availability: Usually ships in 1-2 business days
Buy Used: from $17.86 (click here)
Category: Book
See more book details and other editions


(Click here)
Buy this book at online book store in your country
Canada | UK | Germany | France

Book Summary Information

Author: Jeffrey E.F. Friedl
Edition: Paperback
Audio: English (Unknown); English (Original Language); English (Published)
Published: 2006-08-15
ISBN: 0596528124
Number of pages: 544
Publisher: O'Reilly Media

Book Reviews of Mastering Regular Expressions

Book Review: Good guide to regular expressions in all kinds of situations
Summary: 5 Stars

This book is about a very powerful programming tool. Most documentation that mentions regular expressions doesn't even begin to hint at their power, but this book is about mastering regular expressions. Regular expressions are available in many types of tools such as editors, word processors, system tools, and database engines, but their power is most fully exposed when available as part of a programming language. Examples include Java, Visual Basic, Perl, VBScript, JavaScript, sed, and awk. Regular expressions are the very heart of many programs written in some of these languages.

This book will interest anyone who has an opportunity to use regular expressions. If you don't yet understand the power that regular expressions can provide, you should benefit greatly as a whole new world is opened up to you. This book should expand your understanding, even if you consider yourself an accomplished regular expression expert. Programmers working on text-related tasks, such as web programming, will find a gold mine of detail, hints, tips, and understanding that can be put to immediate use. I've not found this level of detail and thoroughness in any other book.

Regular expressions are an idea that is implemented in various ways by various utilities. If you master the general concept of regular expressions, you'll find it easier to use a particular implementation. This book concentrates on that idea, so most of the knowledge presented here transcends the utilities and languages used to present the examples. You'll probably get the most out of this book by reading the first six chapters in sequence. The last four chapters cover regular expression specifics of Perl, Java, .NET, and PHP, and here is where you can skip around based on your need.

Chapter 1, Introduction to Regular Expressions, is geared toward the complete novice. It introduces the concept of regular expressions using the widely available program egrep, and offers the author's perspective on how to think regular expressions, instilling a solid foundation for the advanced concepts presented in later chapters. Even readers with prior experience would do well to skim this first chapter.

Chapter 2, Extended Introductory Examples, looks at real text processing in a programming language that has regular expression support. The additional examples provide a basis for the detailed discussions of later chapters, and show additional important thought processes behind crafting advanced regular expressions. To provide a feel for how to "speak in regular expressions," this chapter takes a problem requiring an advanced solution and shows ways to solve it using two unrelated regular-expression-wielding tools.

Chapter 3, Overview of Regular Expression Features and Flavors, provides an overview of the wide range of regular expressions commonly found in tools today. Due to their turbulent history, current commonly-used regular expression flavors can differ greatly. This chapter also takes a look at a bit of the history and evolution of regular expressions and the programs that use them. The end of this chapter also contains a guide to the advanced chapters. This guide is your road map to getting the most out of the advanced material that follows

Chapter 4, The Mechanics of Expression Processing, ratchets up the pace several notches and begins the central core of this book. It looks at the important inner workings of how regular expression engines really work from a practical point of view. Understanding the details of how regular expressions are handled goes a very long way toward allowing you to master them. The next chapter puts that knowledge to high-level, practical use. Common but complex problems are explored in detail, all with the aim of expanding and deepening your regular expression experience. Chapter 6 looks at the real-life efficiency ramifications of the regular expressions available to most programming languages. This chapter puts information detailed in Chapters 4 and 5 to use for exploiting an engine's strengths and stepping around its weaknesses.

Chapter 7 closely examines regular expressions in Perl, arguably the most popular regular expression-laden programming language in use today. It has only four operators related to regular expressions, but their myriad of options and special situations provides an extremely rich set of programming options and pitfalls. The very richness that allows the programmer to move quickly from concept to program can be a minefield for the uninitiated. This detailed chapter clears a path.

Chapter 8, on regular expressions in Java, looks in detail at the java.util.regex regular expression package, a standard part of the language since Java 1.4. The chapter's primary focus is on Java 1.5, but differences in both Java 1.4.2 and Java 1.6 are noted. Chapter 9 contains the documentation for the .NET regular expression library that Microsoft neglected to provide. This chapter provides the details you need to employ .NET regular-expressions to the fullest regardless of what base language you're working in. Chapter 10 provides a short introduction to the multiple regex engines embedded within PHP, followed by a detailed look at the flavor and API of its regex suite, powered under the hood by the PCRE regex library.

Overall, this is a very complete guide to regular expressions with plenty of examples and I highly recommend it.

Summary of Mastering Regular Expressions

Regular expressions are an extremely powerful tool for manipulating text and data. They are now standard features in a wide range of languages and popular tools, including Perl, Python, Ruby, Java, VB.NET and C# (and any language using the .NET Framework), PHP, and MySQL.

If you don't use regular expressions yet, you will discover in this book a whole new world of mastery over your data. If you already use them, you'll appreciate this book's unprecedented detail and breadth of coverage. If you think you know all you need to know about regular expressions, this book is a stunning eye-opener.

As this book shows, a command of regular expressions is an invaluable skill. Regular expressions allow you to code complex and subtle text processing that you never imagined could be automated. Regular expressions can save you time and aggravation. They can be used to craft elegant solutions to a wide range of problems. Once you've mastered regular expressions, they'll become an invaluable part of your toolkit. You will wonder how you ever got by without them.

Yet despite their wide availability, flexibility, and unparalleled power, regular expressions are frequently underutilized. Yet what is power in the hands of an expert can be fraught with peril for the unwary. Mastering Regular Expressions will help you navigate the minefield to becoming an expert and help you optimize your use of regular expressions.

Mastering Regular Expressions, Third Edition, now includes a full chapter devoted to PHP and its powerful and expressive suite of regular expression functions, in addition to enhanced PHP coverage in the central "core" chapters. Furthermore, this edition has been updated throughout to reflect advances in other languages, including expanded in-depth coverage of Sun's java.util.regex package, which has emerged as the standard Java regex implementation.Topics include:

  • A comparison of features among different versions of many languages and tools
  • How the regular expression engine works
  • Optimization (major savings available here!)
  • Matching just what you want, but not what you don't want
  • Sections and chapters on individual languages

Written in the lucid, entertaining tone that makes a complex, dry topic become crystal-clear to programmers, and sprinkled with solutions to complex real-world problems, Mastering Regular Expressions, Third Edition offers a wealth information that you can put to immediate use.

Reviews of this new edition and the second edition:

"There isn't a better (or more useful) book available on regular expressions."

--Zak Greant, Managing Director, eZ Systems

"A real tour-de-force of a book which not only covers the mechanics of regexes in extraordinary detail but also talks about efficiency and the use of regexes in Perl, Java, and .NET...If you use regular expressions as part of your professional work (even if you already have a good book on whatever language you're programming in) I would strongly recommend this book to you."

--Dr. Chris Brown, Linux Format

"The author does an outstanding job leading the reader from regex novice to master. The book is extremely easy to read and chock full of useful and relevant examples...Regular expressions are valuable tools that every developer should have in their toolbox. Mastering Regular Expressions is the definitive guide to the subject, and an outstanding resource that belongs on every programmer's bookshelf. Ten out of Ten Horseshoes."

--Jason Menard, Java Ranch


Regular expressions are a central element of UNIX utilities like egrep and programming languages such as Perl. But whether you're a UNIX user or not, you can benefit from a better understanding of regular expressions since they work with applications ranging from validating data-entry fields to manipulating information in multimegabyte text files. Mastering Regular Expressions quickly covers the basics of regular-expression syntax, then delves into the mechanics of expression-processing, common pitfalls, performance issues, and implementation-specific differences. Written in an engaging style and sprinkled with solutions to complex real-world problems, Mastering Regular Expressions offers a wealth information that you can put to immediate use.

Specific Databases Books

Book Subjects
Most talked about in Specific Databases Books
Navegar en Internet. Creación de un portal con PHP y MySQL. 3ª edición. ImageNavegar en Internet. Creación de un portal con PHP y MySQL. 3ª edición.
UNKNOWN; Perfect Paperback; Book
MySQL. Das Praxisbuch. ImageMySQL. Das Praxisbuch.
by Matthias Kannengiesser
Franzis; Published: 2003-06-01; Hardcover; Book
Best price: $32.33
PHP-MySQL avec Dreamweaver MX ImagePHP-MySQL avec Dreamweaver MX
by Jean-Marie Defrance
Eyrolles; Published: 2003-05-22; Paperback; Book
FileMaker Instant Web Publishing VTC Training CD ImageFileMaker Instant Web Publishing VTC Training CD
by David Wheelock
Virtual Training Company, Inc.; Published: 2007-04-04; CD-ROM; Book
Best price: $99.95
dBASE IV for Windows: A Developers Resource Book ImagedBASE IV for Windows: A Developers Resource Book
by Jack L. Hursch, Carolyn J. Hursch
Windcrest; Published: 1993-03; Paperback; Book
Price in other shops: $32.95
Head First SQL: Your Brain on SQL -- A Learner's Guide ImageHead First SQL: Your Brain on SQL -- A Learner's Guide
by Lynn Beighley
O'Reilly Media; Published: 2007-09-01; Paperback; Book
Best price: $20.00
Price in other shops: $44.99
Backup & Recovery: Inexpensive Backup Solutions for Open Systems ImageBackup & Recovery: Inexpensive Backup Solutions for Open Systems
by W. Curtis Preston
O'Reilly Media; Published: 2007-01-10; Paperback; Book
Best price: $25.55
Price in other shops: $49.99
Programming PHP ImageProgramming PHP
by Rasmus Lerdorf, Kevin Tatroe, Peter MacIntyre
O'Reilly Media; Published: 2006-05-05; Paperback; Book
Best price: $19.55
Price in other shops: $39.99
Inside the dBASE Professional Compiler ImageInside the dBASE Professional Compiler
by Tony Lima
John Wiley & Sons Inc (Computers); Published: 2000-12; Paperback; Book
Price in other shops: $32.95
dBASE IV Systems Development Handbook ImagedBASE IV Systems Development Handbook
by Beth Galdeiri
Prentice Hall Trade; Published: 1991-06; Hardcover; Book
Price in other shops: $49.95
Similar Books and other products
Design Patterns: Elements of Reusable Object-Oriented Software ImageDesign Patterns: Elements of Reusable Object-Oriented Software
by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides
Addison-Wesley Professional; Published: 1994-11-10; Hardcover; Book
Best price: $31.49
Price in other shops: $59.99
Perl Cookbook, Second Edition ImagePerl Cookbook, Second Edition
by Tom Christiansen, Nathan Torkington
O'Reilly Media; Published: 2003-08-28; Paperback; Book
Best price: $27.55
Price in other shops: $49.95
Programming Perl (3rd Edition) ImageProgramming Perl (3rd Edition)
by Larry Wall, Tom Christiansen, Jon Orwant
O'Reilly Media; Published: 2000-07-21; Paperback; Book
Best price: $19.55
Price in other shops: $49.99
Classic Shell Scripting ImageClassic Shell Scripting
by Arnold Robbins, Nelson H.F. Beebe
O'Reilly Media; Published: 2005-02-01; Paperback; Book
Best price: $20.55
Price in other shops: $39.99
Learning the bash Shell: Unix Shell Programming (In a Nutshell (O'Reilly)) ImageLearning the bash Shell: Unix Shell Programming (In a Nutshell (O'Reilly))
by Cameron Newham
O'Reilly Media; Published: 2005-04-05; Paperback; Book
Best price: $19.47
Price in other shops: $34.95
Learning the vi and Vim Editors ImageLearning the vi and Vim Editors
by Arnold Robbins, Elbert Hannah, Linda Lamb
O'Reilly Media; Published: 2008-07-22; Paperback; Book
Best price: $19.79
Price in other shops: $34.99
Learning Perl ImageLearning Perl
by Randal L. Schwartz, brian d foy, Tom Phoenix
O'Reilly Media; Published: 2011-07-01; Paperback; Book
Best price: $22.24
Price in other shops: $39.99
Regular Expression Pocket Reference: Regular Expressions for Perl, Ruby, PHP, Python, C, Java and .NET (Pocket Reference (O'Reilly)) ImageRegular Expression Pocket Reference: Regular Expressions for Perl, Ruby, PHP, Python, C, Java and .NET (Pocket Reference (O'Reilly))
by Tony Stubblebine
O'Reilly Media; Published: 2007-07-25; Paperback; Book
Best price: $8.49
Price in other shops: $14.99
Regular Expressions Cookbook ImageRegular Expressions Cookbook
by Jan Goyvaerts, Steven Levithan
O'Reilly Media; Published: 2009-05-29; Paperback; Book
Best price: $21.55
Price in other shops: $44.99
sed & awk (2nd Edition) Imagesed & awk (2nd Edition)
by Dale Dougherty, Arnold Robbins
O'Reilly Media; Published: 1997-03-08; Paperback; Book
Best price: $17.55
Price in other shops: $39.99
Book store. Illustrated catalog of books on different categories