Regex engine in Rust (Thompson NFA and bounded lazy DFA cache) (github.com) 2 points by akgitrepos 4mo ago ↗ HN
[–] akgitrepos 4mo ago ↗ Built a small regex engine in Rust and would love feedback from people who’ve implemented/search-optimized regex before.- Thompson NFA core (no recursive backtracking engine) - Bounded lazy transition cache for repeated scans - v1 supports: literals, ., concat, |, * + ?, grouping, classes/ranges, \d \w \s \t \n, ^ $ - APIs: compile, is_match, find_first, find_all - Contract-style conformance tests + microbenchmarks includedRepo: https://github.com/akgitrepos/regex-engine-rustCurious where you’d take it next: captures first, Unicode semantics, or deeper DFA optimization?
1 comment
[ 3.4 ms ] story [ 15.0 ms ] thread- Thompson NFA core (no recursive backtracking engine) - Bounded lazy transition cache for repeated scans - v1 supports: literals, ., concat, |, * + ?, grouping, classes/ranges, \d \w \s \t \n, ^ $ - APIs: compile, is_match, find_first, find_all - Contract-style conformance tests + microbenchmarks included
Repo: https://github.com/akgitrepos/regex-engine-rust
Curious where you’d take it next: captures first, Unicode semantics, or deeper DFA optimization?