Regex, forged in Rust.
Ferroni is a pure-Rust port of the Oniguruma regex engine — the engine behind Ruby, PHP, and TextMate grammars. Full feature parity with the C original. Up to 59x faster on scanner workloads.
Full compatibility. No compromises.
Ferroni does not wrap Oniguruma. It ports the engine into Rust, keeps the same structure and optimization pipeline, then tunes the runtime path hard.
Built for scanner speed
Up to 59x faster first-match latency. 31x faster full-line tokenization. Tuned for the hot path in syntax highlighters and text scanners.
Full Oniguruma compatibility
Named captures, variable-length lookbehind, conditionals, absent expressions, 886 Unicode properties, subexpression calls. If it works in Oniguruma, it works in Ferroni.
Pure Rust, no C toolchain
cargo add ferroni and build. Cross-compiles to wasm32-unknown-unknown. No node-gyp, no local C compiler. Only 0.4% unsafe code, all documented.
Built-in multi-pattern scanner
Drop-in compatible with vscode-oniguruma. Regex engine and TextMate grammar scanner in a single dependency. Used by Shiki and VS Code.
Measured, not claimed.
Every number comes from battle_bench, a head-to-head benchmark suite running Ferroni against Oniguruma on the same inputs. No cherry-picked subsets.
Full benchmark tables and methodology in Benchmark Results
Three lines to your first match
Add Ferroni as a dependency. Write a pattern. Match.
use ferroni::prelude::*; fn main() -> Result<(), RegexError> { let re = Regex::new(r"(?<year>\d{4})-(?\u003cmonth\u003e\d{2})")?; let caps = re.captures("Date: 2026-02-12").unwrap(); assert_eq!(caps.name("year").unwrap().as_str(), "2026"); Ok(()) }
The Oniguruma ecosystem, unlocked
Ferroni works wherever Oniguruma does. These projects all depend on Oniguruma’s feature set — and Ferroni covers it completely.
Start building with Ferroni
Full Oniguruma compatibility with dramatically better performance. One dependency. Pure Rust.