C.W.K.
Stream
← C.W.K. Quests
🔍

RegEx Quest

Updated: 2026-05-04

Tame the pattern-matching beast

Regular expressions are the universal text-shape language. Eight tracks, ninety lessons — from the first literal character to ReDoS defense. By the end you'll write production-quality patterns, debug them under pressure, and know exactly when to reach for a real parser instead.

8 tracks · 90 lessons · ~22h · difficulty: beginner-to-advanced

Level 0Pattern-Curious
0 XP0/90 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete

Regex is one of the highest-leverage tools in any developer's kit. Once you internalize it, you reuse it everywhere — editors, shells, languages, databases, log pipelines, code mods, security scanners. This quest takes you from "the dot matches anything" all the way to atomic groups, recursive patterns, and ReDoS defense.

The first track grounds the mental model: regex is a shape language, not a parser. Tracks 2-5 cover the full grammar — character classes, quantifiers, groups, lookaround. Track 6 maps it to every environment you actually use: Python, JavaScript, grep, ripgrep, sed, your editor, your database. Track 7 hands you twelve real-world patterns to lift directly into your code. Track 8 graduates you with the dark arts: atomic groups, recursion, catastrophic backtracking, and the judgment to know when regex is the wrong tool.

By the end you should be able to: read any regex out loud and translate it to one English sentence; write production-quality patterns with verbose mode and named groups; debug a misbehaving pattern with regex101 in under a minute; recognize ReDoS-vulnerable shapes before they ship; and know — really know — when the right move is to put the regex down and reach for a parser instead.

Tracks

  1. 01🔍What Are Regular Expressions?

    0/10 lessons

    Patterns, engines, and the moment regex stops looking like noise

    Regex is a tiny language for describing text shapes. Before you memorize a single metacharacter, you need a clear picture of what regex *is* — a compact pattern grammar that a finite-state engine sweeps across your text. This track grounds you in that mental model: where regex shines, where it ruins your weekend, how to read a pattern slowly, and the one rule that protects you from every regex disaster down the road.

    Lesson list (10)Quiz · 5 questions
  2. 02🔤Character Classes & Basics

    0/12 lessons

    Building blocks: literals, dots, classes, anchors, boundaries

    Every regex you'll ever write is built from the same dozen-or-so primitives. This track covers them in order: literal characters, the universal dot, custom character classes with brackets, shorthand classes like \d and \w, the negation tricks that flip them inside out, and the anchors and word boundaries that pin matches to specific positions. By the end of the track you'll be writing patterns for phone numbers, dates, and emails — not by memorizing recipes, but by composing primitives.

    Lesson list (12)Quiz · 5 questions
  3. 03Quantifiers

    0/12 lessons

    How many times? Greedy, lazy, possessive — and the engine moves you can't see

    Quantifiers tell the engine how many times to repeat the previous piece. <code>*</code>, <code>+</code>, <code>?</code>, <code>{n}</code>, <code>{n,m}</code> — five operators that look simple and contain the entire performance story of regex. This track covers every quantifier, the difference between greedy and lazy matching (and why it changes results), the possessive variant that disables backtracking, and the practical patterns where one quantifier choice determines whether your code ships or stalls in production.

    Lesson list (12)Quiz · 5 questions
  4. 04🎯Groups & Alternation

    0/12 lessons

    Capture, name, reuse — and the | that splits patterns into branches

    Groups turn regex from a search-and-match tool into a parsing tool. Parentheses do four jobs: scoping quantifiers, capturing values for later use, naming pieces for clarity, and providing a target for backreferences. Alternation (the <code>|</code> operator) lets one pattern match multiple alternatives. Together they're how you go from "find the email" to "find the email AND extract the local part AND domain separately, with names that make the calling code readable."

    Lesson list (12)Quiz · 5 questions
  5. 05👁️Lookahead & Lookbehind

    0/10 lessons

    Match positions instead of characters — the zero-width family

    Lookaround assertions check what's around the current position WITHOUT consuming it. They're how you say 'a digit followed by a letter' or 'a word that is NOT preceded by a dollar sign.' Zero-width — the engine peeks, asserts, and stays put. This track covers the four lookarounds (positive/negative × ahead/behind), the flavor caveats (lookbehind is the most fragmented feature in regex), and the patterns where lookaround unlocks things impossible with normal matching.

    Lesson list (10)Quiz · 5 questions
  6. 06🌐Regex in Programming Languages

    0/10 lessons

    Python, JavaScript, grep, sed, your editor, your database — same idea, dozen APIs

    You've learned the regex grammar. Now it's time to use it where you actually live: in Python, JavaScript, the terminal, your editor, your database. Each environment exposes regex through a different API with different flags, different replacement syntax, and slightly different semantic edges. This track is the practical translation guide — same patterns, different doorways.

    Lesson list (10)Quiz · 5 questions
  7. 07🛠️Real-World Patterns

    0/12 lessons

    Steal-and-adapt patterns for the things you actually parse

    Twelve patterns you'll lift directly into your code. Email, URL, IP, dates, log lines, CSV, Markdown, semver, file paths, phone numbers, code constructs, cleanup. Each comes with a sane default, the variants you'll likely need, the gotchas the regex doesn't catch, and a decision rule for when to use a real parser instead. By the end, your reflex for these problems should be: open this lesson, copy, adapt, ship.

    Lesson list (12)Quiz · 5 questions
  8. 08👑Advanced Patterns & Mastery

    0/12 lessons

    Atomic groups, recursion, ReDoS, optimization — and knowing when to put regex down

    Beyond the practical 80%. Atomic groups and possessive quantifiers that disable backtracking, recursive patterns that match nested structure, branch reset groups that flatten capture numbering, Unicode property categories. The dark arts: catastrophic backtracking, ReDoS attacks, and how to write patterns that survive adversarial input. Optimization techniques. Debugging strategy. And the most important advanced lesson — knowing when regex is the wrong tool and reaching for something better.

    Lesson list (12)Quiz · 5 questions
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.