Regex Training Sessions

A 10-session curriculum taking you from absolute beginner to production-grade regex. Each session builds on the previous, with hands-on exercises, real infrastructure data, and immediate practical application.

Training Philosophy

  1. Absolute basics first - No assumed knowledge

  2. Hands-on practice - Type patterns, see results

  3. Real data - Use infrastructure logs, configs, notes

  4. Tool coverage - grep, sed, awk, vim, Python

  5. Production focus - Performance, security, maintainability

Sessions

Session Focus Duration Status

01

Absolute Basics - Literals, metacharacters, character classes

30 min

Ready

02

Quantifiers & Flavors - BRE, ERE, PCRE differences

60 min

Ready

03

Groups & Capturing - Extraction, backreferences, named groups

45 min

Ready

04

Lookahead & Lookbehind - Context-aware matching, \K escape

45 min

Ready

05

sed Mastery - Stream editing, substitutions, transformations

60 min

Ready

06

awk Regex Power - Field extraction, pattern-action processing

60 min

Ready

07

vim Regex - Search, substitute, global command, case conversion

45 min

Ready

08

Python re Module - Automation, parsing, named groups

60 min

Ready

09

Advanced Patterns - Multi-line, nested, recursive, edge cases

75 min

Ready

10

Performance & Optimization - ReDoS, backtracking, production patterns

60 min

Ready

Total curriculum time: ~9 hours

Guides

Guide Purpose

CLI Workout

Stop reading, start typing. Structured grep/sed/awk exercises.

Real-World Applications

Professional (ISE, network, security) AND personal (notes, finances, journals) patterns.

Self-Test Challenges

Test your skills with progressive difficulty exercises.

Common Gotchas

Avoid the traps that catch everyone.

Curriculum Structure

Phase 1: Fundamentals (Sessions 01-02)

Build the foundation. Understand metacharacters, character classes, quantifiers. Learn the difference between BRE, ERE, and PCRE.

Phase 2: Power Features (Sessions 03-04)

Master extraction with capture groups and context-aware matching with lookaround. These are the features that separate beginners from intermediate users.

Phase 3: Tool Mastery (Sessions 05-07)

Apply regex in the tools you use daily: sed for transformations, awk for field processing, vim for editing. Each tool has its quirks.

Phase 4: Automation (Sessions 08-10)

Move beyond one-liners to Python automation. Handle complex real-world patterns. Optimize for production performance and security.

Tools

  • regexr.com - Interactive regex tester (recommended for learning)

  • regex101.com - Detailed explanation of patterns with PCRE/Python support

  • ripgrep (rg) - Fast grep with PCRE2 support

  • Python REPL - import re for testing patterns

Quick Reference

Concept BRE/ERE PCRE

Literal matching

foo matches "foo"

Same

Any character

.

Same

Character class

[abc], [a-z]

Same

Negated class

[^abc]

Same

Start/End anchor

^, $

Same

Word boundary

\<, \> (BRE)

\b

Quantifiers

*, +, ?, {n,m}

Same + lazy *?, +?

Grouping

\(\) (BRE), () (ERE)

()

Alternation

| (BRE), | (ERE)

|

Lookahead

Not supported

(?=…​), (?!…​)

Lookbehind

Not supported

(?⇐…​), (?<!…​)

Named groups

Not supported

(?P<name>…​)

Progress Tracking

Each session document includes:

  • Pre-session setup and test data

  • Lessons with examples and exercises

  • Self-check solutions (collapsible)

  • Connection to practical work

After completing all 10 sessions, you’ll be able to:

  • Write patterns for any text extraction task

  • Choose the right tool (grep/sed/awk/vim/Python)

  • Avoid performance pitfalls

  • Build maintainable pattern libraries

  • Handle edge cases that break naive patterns

Training Agreement - Commit to deliberate practice.