Regular Expressions
Most of Ruby’s built-in types will be familiar to all programmers. A majority of languages have strings, integers, floats, arrays, and so on. But not all languages have built-in support for regular expressions the way that Ruby or JavaScript do. This is a shame because regular expressions, although cryptic, are a powerful tool for working with text. And having them built in rather than tacked on through a library interface, makes a big difference.
Entire books have been written about regular expressions (for example, Mastering Regular Expressions by Jeffrey Friedl), so we won’t try to cover everything in this short section. Instead, we’ll look at a few examples of regular expressions in action. You’ll find more coverage ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access