Implementing Regular Expressions
An introduction to using finite automata to implement regular expression matching, and why the standard backtracking implementation is a bad idea. Supporting programs: NFA | DFA | bounded-memory DFA | timing scripts NFAs with submatch tracking: Perl rules | POSIX rules Transliteration of Thompson's code for bytecode machine and x86, by Jan Burgy. “Regular Expression Matching: the Virtual Machine Approach” An introduction to submatch tracking during efficient (non-backtracking) NFA-based regular expression matching. Supporting programs: https://github.com/rsc/re1/ “Regular Expression Matching in the Wild” A tour of RE2, an efficient, production regular expression implementation. Supporting programs: https://github.com/google/re2/ “Regular Expression Matching with a Trigram Index” How Google Code Search worked. Supporting programs: https://github.com/google/codesearch/ “IBM 7094 Cheat Sheet” If you want to read Ken Thompson's original 1968 paper (see below), you'll want to take this with
Implementing Regular Expressions Implementing Regular Expressions Russ Cox rsc@swtch.com This page collects resources about implementing regular expression search efficiently. Articles and Notes " Regular Expression Matching Can Be Simple And Fast " An introduction to using finite automata to implement regular expression matching, and why the standard backtracking implementation is a bad idea. Supporting programs: NFA | DFA | bounded-memory DFA | timing scripts NFAs with submatch tracking: Perl rules | POSIX rules Transliteration of Thompson's code for bytecode machine and x86 , by Jan Burgy.
Explore this link on the map →related reading
- Thompson's construction - Wikipediaen.wikipedia.org
- Regular expression - Wikipediaen.wikipedia.org
- GitHub - kyx0r/pikevm: Russ Cox/Rob Pike pikevm regex implementation · GitHubgithub.com
- Regular Expression Matching with a Trigram Indexswtch.com
- Fast regex search: indexing text for agent tools · Cursorcursor.com
- An additional non-backtracking RegExp engine · V8v8.dev
- GitHub - google/re2: RE2 is a fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python. It is a C++ library. · GitHubgithub.com
- The Regular Expression Denial of Service (ReDoS) cheat-sheet | by James Davis | Level Up Codinglevelup.gitconnected.com
- Regular expression HOWTO — Python 3.14.6 documentationdocs.python.org
- Tristan's Site - Tristan Humethume.ca
- Aho-Corasick Algorithm for Pattern Searching - GeeksforGeeksgeeksforgeeks.org
- Solving regex crosswords with Z3 - Made of Bugsblog.nelhage.com