Regex Engine
Build a regular expression engine from scratch in modern C++ using only the standard library. You parse a pattern into a syntax tree, compile it to an NFA via Thompson construction, then simulate the automaton to match input. A theory-meets-practice project on automata and parsing.
Support Free C++ Education
Help us keep this platform free for everyone! Your support enables us to create more high-quality lessons, exercises, and interactive content.
What You'll Build
A regex library that supports concatenation, alternation, the star, plus, and optional quantifiers, and character classes, matching strings by simulating a compiled NFA.
Learning Objectives
- Parse a regex pattern into an abstract syntax tree
- Compile the tree into an NFA with Thompson construction
- Represent states and transitions with std::vector and std::unique_ptr
- Simulate the NFA over input with epsilon-closure sets
- Support quantifiers, alternation, and character classes
- Optionally convert the NFA to a DFA via subset construction
- Manage node ownership and lifetimes with move semantics
Coming Soon
This project is in development. Register your interest and we'll email you the moment it goes live.
No spam. Unsubscribe anytime.
Coming Soon
This project is in development. Register your interest and we'll email you the moment it goes live.
No spam. Unsubscribe anytime.