Regular expressions
Understand the idea. Try the code. Take one small step forward.
01—03 · Pattern foundations
Understand escaping, character classes, quantifiers and boundaries.
04—06 · Extraction & transformation
Combine captures, assertions and replacement callbacks.
07—08 · Reliability & practice
Handle Unicode, matching state and log parsing.
Study the mechanism, run the example, then attempt the challenge before opening the solution. Every chapter includes verification and common boundaries.
Regex foundations: patterns, escaping and full matches
Distinguish literal strings from patterns and build testable input rules.
Character classes, whitespace and word boundaries
Understand single-character classes and express allowed characters precisely.
Quantifiers, greediness and explicit delimiters
Control repetition and understand greedy versus lazy selection.
Groups, alternatives and named captures
Extract fields and distinguish captures from grouping-only constructs.
Anchors, flags and zero-width assertions
Distinguish line boundaries, dot behavior and assertions that do not consume text.
Replacement and extraction with callbacks
Extract fields with matchAll and perform predictable transformations with replacement callbacks.
Unicode and stateful matching
Handle non-ASCII text and avoid alternating validation results from g.
Project: log parsing and performance boundaries
Parse simple logs in stages, retain rejected line numbers and bound input size.