← Presentation home · Part 1 of 12

Regex Therapy - Overview

Part 1 · Regex Therapy - Overview

No slide image for this part. Notes below.

← All parts Next →

Deep dive

Regex Therapy - Overview

Why Regex Matters

Regular expressions look like gibberish. That's the first thing everyone thinks. They see something like this:

^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$

And their brain says "nope."

Here's the secret: you don't need to write monsters like that. Most real-world regex is simple. Five or six characters that save you hours of tedious work. Once you learn the basics, you'll wonder how you ever lived without them.

What We're Actually Doing

This tutorial teaches you regex through three practical tools:

1. ack     - Search files for patterns (like grep, but better)
2. rename  - Bulk rename files with patterns
3. perl    - One-liner text transformations

All three use the same regex syntax. Perl-compatible regular expressions (PCRE). Learn it once, use it everywhere.

+-----------+       +-----------+       +-----------+
|           |       |           |       |           |
|    ack    |       |  rename   |       |   perl    |
|           |       |           |       |           |
+-----+-----+       +-----+-----+       +-----+-----+
      |                   |                   |
      |                   |                   |
      +--------+----------+----------+--------+
               |                     |

v v Same Regex Same Regex Syntax Syntax

The AI Connection

If you're running local AI, you're generating a lot of output that needs processing:

Regex is the glue. It's how you parse AI output, rename generated files, and extract the data you actually need. This is foundation work for everything we do with local AI pipelines.

What You'll Learn

By the end of this tutorial, you'll know how to:

- Find all files containing a word (or NOT containing it)
- Rename hundreds of files in one command

We start simple. Single characters. Then we build up to patterns that would take you forever to do by hand.

What You Need

- A folder with some files to practice on

We'll install the tools as we go.

How This Tutorial is Organized

01. Overview (you are here)
02. Installing the Tools
03. Regex Fundamentals - The Building Blocks
04. Regex Fundamentals - Combining Patterns
05. ack - Searching Like a Pro
06. ack - Advanced Techniques
07. rename - Bulk File Operations
08. rename - Pattern Capture Magic
09. Perl One-Liners - The Basics
10. Perl One-Liners - Real World Examples
11. Quick Reference Card
12. Practice Exercises

Each section builds on the last. Don't skip ahead.