Strung Ruby

Ruby's facilities for working with strings are second to none. Learn how to leverage that power in searching, replacing, parsing, and transforming …

Lazy, Greedy Regular Expressions

Laziness and greed: in regular expressions, both can be virtues… but not at the same time. In this video we learn about a tiny toggle…

Null-Terminated Record

Before YAML, before JSON, there were null-terminated records. See how this simple, pragmatic technique greases the pipes between UNIX command-line too…

Chomp

Ruby can be your multitool for all kinds of text-munging tasks. But to use it effectively, you need to understand how Ruby handles line endings and re…

Input Record Separator

Ruby has a lot of tools for processing input line-by-line. But when you look a little closer, it turns out that these methods are for more than just l…

Output Record Separator

Did you know Ruby has a `print` method in addition to `puts`? Did you know it's for record-oriented output? Do you know how to control the formatting …

Autosplit

Ruby has tools like -n and -p for filtering and summarizing text right from the command-line. But what about columnar input, like process listings or …

Ruby as a Filter

Learn how Ruby's -p flag along with a bunch of handy shortcuts can take a script's worth of text filtering and shrink it to a one-liner!