Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Ruby, like many other languages, contains a powerful text-processing shortcut that looks like it was created by cats walking on the keyboard. Regular expressions can be very difficult to read, especially as they grow longer, but they offer tremendous power that’s hard to re-create in Ruby code. As long as you stay within a modest subset of regular expressions, you can get a lot done without confusing anyone—yourself included—who’s trying to make sense out of your program logic.
For a much more comprehensive guide to regular expressions, see Jeffrey E. F. Friedl’s classic Mastering Regular Expressions (O’Reilly) or Tony Stubblebine’s compact but extensive Regular Expression Pocket Reference (O’Reilly).