O'Reilly logo

Text Processing with Ruby by Rob Miller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Pattern Syntax

It’s beyond the scope of this book to teach regular expressions in their entirety. But it’s not necessary to learn anything close to the entirety of regular expressions to productively use them to process text. In the rest of this chapter, we’ll take a tour of the fundamentals of regular expressions—that 20 percent of functionality that allows you to perform 80 percent of the tasks you’ll encounter.

Regular expression syntax is, as we’ve discussed, famously terse. This terseness makes it relatively unintuitive. There’s sometimes no astoundingly logical reason why a particular special character represents a particular pattern, apart from that it hadn’t already been used for something else. But this terseness brings great power, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required