skipnothing/Regex Engines

Regex Engines

Patterns compile to graphs. Engines walk them by NFA, DFA, or backtracking. See why one regex is instant and another hangs.

You've written or copy-pasted a regex at least once, used a `replace()` or `match()` call in some language, and know what 'characters' and 'strings' are in code.

Loading…
01

Anatomy of a Pattern

Characters, classes, anchors, alternation, quantifiers, groups

3/3
02

The NFA

Thompson construction, state machines, the regex as a graph

2/2
03

The DFA

Subset construction, when engines convert, the speed trade

2/2
04

Backtracking & Catastrophe

Recursive descent, capture, backreferences, the patterns that hang

3/3
05

Beyond ASCII

Unicode properties, grapheme clusters, normalization, the multi-codepoint character

2/2
View full 12-topic curriculum