Learn
Nine tracks, in the order they build on each other. Every claim in a lesson is a pattern you can run against the same engine that grades you, right beside the sentence that makes it.
Literals and classes
Which characters does this actually match?
Escaping, ranges, negation, and the shorthand classes — including what \w really is, which is not what the name suggests and is the reason half the email validators in the world reject a real address.
- Characters and escapes8 min
- Classes and ranges12 min
- The shorthand classes, and what they are not12 min
3 lessons · 3 tasks
Quantifiers and greed
How much does it take, and what does it hand back?
*, +, ? and {n,m}, greedy against lazy, and the give-back watched one step at a time. Lazy does not mean efficient, and the step meter is where that stops being an opinion.
- How many12 min
- Greedy, lazy, and the give-back12 min
2 lessons · 3 tasks
Anchors and boundaries
Where is the pattern allowed to start?
^ and $, what m does to them, \b and its definition — and why a validator without anchors validates nothing at all.
- Start and end12 min
- Lines, and the word boundary8 min
2 lessons · 2 tasks
Groups, captures and backreferences
What did you actually get back?
Numbering, named groups, non-capturing groups, and the two answers a group can give that look the same and are not: it matched nothing, or it never ran.
- Capturing what you matched12 min
- Backreferences12 min
2 lessons · 4 tasks
Alternation and order
Why did it pick that branch?
Leftmost, not longest. Reordering two branches is a correctness change, and the trace of an alternation that never reaches its second branch is the clearest way to see why.
- Leftmost, not longest12 min
- Branches that never run8 min
2 lessons · 2 tasks
Lookaround
How do you test without consuming?
Lookahead and lookbehind as zero-width assertions, and the password-rule pattern rebuilt honestly.
- Looking without taking12 min
- Looking behind8 min
2 lessons · 3 tasks
Catastrophic backtracking
Why has it not come back?
Nested quantifiers, overlapping alternation, the two engines side by side, and rewriting to something linear — or deciding to stop using a regular expression.
- Why it has not come back12 min
- The other machine12 min
2 lessons · 3 tasks
Unicode and flags
What is a character, exactly?
u and code points, case folding, s and y, and what changes when you move the pattern to another flavour.
3 lessons · 3 tasks
Reading a generated regex
What will this match that you did not intend?
The track the rest exists for. You are handed a pattern an agent produced for a stated purpose, with no test inputs. Say what it matches, find the false positive, find the input that hangs it.
18 lessons built so far.