Course
Regular Expressions Mastery
A senior practitioner's guide to regex as a precision tool — engine internals, catastrophic backtracking, lookaround, performance measurement, and the line where a real parser wins.
Reviews
Enrolled members can rate this course.
No reviews yet.
Engine Mechanics and Pattern Literacy
Build the correct mental model of regex engines, matching order, groups, quantifiers, anchors, and lookaround before optimizing anything.
- 01The Regex Engine Mental Model: Search, Not MagicUnderstand how Python's regex engine scans, chooses alternatives, backtracks, and commits to a match so counterintuitive behavior becomes predictable.24mOpen
- 02Anchors, Character Classes, Quantifiers, and Groups Without SuperstitionMaster the small vocabulary that determines most regex behavior, including boundaries, negated classes, capture semantics, and catastrophic quantifier nesting.26mOpen
- 03Lookahead, Lookbehind, Atomic Groups, and Controlled CommitmentUse zero-width assertions to express context without consuming text, understand fixed-width lookbehind limits, and control backtracking with atomic constructs.27mOpen
Safety, Performance, and Debugging
Recognize catastrophic backtracking, measure real costs, control Unicode and escaping edge cases, and debug patterns with evidence instead of superstition.
- 01Catastrophic Backtracking: The Regex Denial-of-Service You Ship YourselfRecognize ambiguous quantifier combinations, reproduce exponential failure safely, and rewrite dangerous patterns using disjointness, anchors, and atomic control.28mOpen
- 02Profiling Regex Performance Like an EngineerMeasure compile versus match costs, input-position effects, allocation overhead, scanner behavior, and realistic adversarial cases before optimizing.23mOpen
- 03Unicode, Flags, Escaping, and the Edges Where Regex LiesControl Unicode semantics, case folding, newline behavior, escaping, bytes-versus-text confusion, and format-specific edge cases that make simple patterns wrong.25mOpen
Production Use and Parser Boundaries
Use regex well for validation, extraction, redaction, and streaming text — and know when nested or contextual data demands a tokenizer or parser.
- 01Validation and Extraction Patterns That Survive Production DataDesign validators and extractors for real operational text — strict where the contract is strict, tolerant where humans write, and explicit about partial matches.24mOpen
- 02Substitution, Redaction, and Streaming Text Without FootgunsUse replacement functions safely, preserve auditability in redaction, handle overlapping and streamed data correctly, and avoid destructive one-shot regex edits.23mOpen
- 03When Regex Becomes a Parser: The Boundary You Should Not CrossRecognize nested, recursive, stateful, and context-sensitive formats; choose tokenizers, parser libraries, or grammars before regex becomes an unmaintainable program.29mOpen