Learning Regular Expressions

Learning Regular Expressions

ISBN: 0134757068

Pages: 144

Publisher: Addison-Wesley – May 25, 2018

Regular expressions and the regular expression language have been around for many years. Regular expression experts have long been armed with an incredibly powerful tool, one that can be used to perform all sorts of powerful text processing and manipulation in just about every language and on every platform.

That’s the good news. The bad news is that for too long, regular expressions have been the exclusive property of only the most tech savvy. Most of us do not fully understand what regular expressions do and what problems they solve. And those who have braved them find regular expression syntax to be unintuitive, and even convoluted at times. That’s sad, because the truth is that regular expressions are nowhere near as complex as they appear to be at first glance. All it takes is a clear understanding of the problem being solved and how to leverage regular expressions so as to solve them.

Part of the problem is the scarcity of quality content on the subject. The few books on regular expressions (and indeed, most of the Web sites boasting regular expression tutorials) tend to concentrate on the syntax, defining what { does and how + differs from *. But that is the easy part; there are not that many special characters in the regular expression language. The tricky part is understanding how they should be used so as to solve real-world problems. If you need to get up and running quickly using regular expressions, you’ll find yourself torn between having too little information to be productive and having too much information to know where to begin.

And that is where this book comes in. Learning Regular Expressions will teach you the regular expressions that you really need to know, starting with simple text matches and working up to more complex topics, including the use of backreferences, conditional evaluation, and lookahead processing. You’ll learn what you can use, and you’ll learn it methodically, systematically, and simply by using clear and practical examples and solving real problems.

To determine if this book is for you, answer these questions: Are you new to regular expressions? Do you want to quickly learn how to get the most out of the regular expression language? Do you want to gain an edge by learning to solve real problems using one of the most powerful (and least understood) tools available to you? Do you build Web applications and crave more sophisticated form and text processing? Are you are a developer (using JavaScript, Java, .NET, PHP, Python, and many other languages, and databases including MySQL) and want to learn how to use regular expressions within your own application development? Do you want to be productive quickly and easily in regular expressions without having to call someone for help? If you answered yes to any of these questions, you’ll find this little book to be exactly what you’ve been looking for.


Chapter listing

  • Introduction
  • 1: Introducing Regular Expressions
  • 2: Matching Single Characters
  • 3: Matching Sets of Characters
  • 4: Using Metacharacters
  • 5: Repeating Matches
  • 6: Position Matching
  • 7: Using Subexpressions
  • 8: Using Backreferences
  • 9: Looking Ahead and Behind
  • 10: Embedding Conditions
  • 11: Regular Expression Solutions to Common Problems
  • Appendix A: Regular Expression in Popular Applications and Languages

Supporting Resources

Lesson 1

As explained in Lesson 1, Introducing Regular Expressions, to really learn regular expressions you can’t just read about them, you need to try them out for yourself. Obviously, you can use your favorite programming language or DBMS for experimenting, but you may find it easier to tinker using a dedicated regular expression tester. To help you in doing so, here are links to some really good online regular expression testers:

Other Editions Of This Title