ferroni 2.1.3

Oniguruma's regex engine in pure Rust: full Oniguruma syntax, a vscode-oniguruma-compatible TextMate scanner, no C toolchain
Documentation

Part of Ferramenta, a family of Rust tools.

Ferroni — Oniguruma's regex engine, modernized in Rust

Powered by Sebastian Software crates.io docs.rs CI Coverage gate at least 87 percent MSRV 1.94 License

Oniguruma-compatible regex matching and scanning in pure Rust. Ferroni ports Oniguruma's parser, compiler and optimizer line by line, verifies UTF-8 behavior against the upstream test suite, and adds an idiomatic Rust API. No C compiler or bindgen required.

Use it for TextMate grammars, patterns with look-around or backreferences, or replacing C Oniguruma in a Rust application.

Explore Ferroni → — matching examples, a visual scanner walkthrough, compatibility evidence and measured performance.

Quick start

cargo add ferroni
use ferroni::prelude::*;

fn main() -> Result<(), RegexError> {
    // A look-behind and named groups: Oniguruma syntax, a familiar API.
    let re = Regex::new(r"(?<=Date: )(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})")?;

    let caps = re.captures("Date: 2026-02-12").unwrap();
    assert_eq!(caps.get(0).unwrap().as_str(), "2026-02-12");
    assert_eq!(caps.name("year").unwrap().as_str(), "2026");
    Ok(())
}

Scope and safety

Ferroni supports ASCII and UTF-8. Other encodings and the POSIX/GNU APIs are outside its scope. It uses backtracking: set timeouts and retry limits for untrusted patterns or input. See compatibility and untrusted input.

When your patterns fit Rust's regex crate, prefer its guaranteed linear-time matching.

Documentation

  • Getting started — captures, iteration, options, errors and the Scanner API.
  • API reference — every public type and function.
  • Benchmarks — workloads, comparison engines, measurement conditions and raw data.
  • Migrating to 2.0 — breaking changes with before and after code.

Project status and contributing

Ferroni is feature-complete for its scope and maintained, with no feature work planned. Bug fixes, Unicode updates, toolchain upkeep and security fixes continue. See the project status for maintenance scope and contribution opportunities.

CONTRIBUTING.md covers builds, tests and benchmarks; architecture decisions define the port's constraints. Report vulnerabilities privately as described in SECURITY.md.

Acknowledgments and license

Built on K. Kosako's Oniguruma and Microsoft's vscode-oniguruma Scanner API and tests. Ferroni is an independent continuation and is not affiliated with or endorsed by Oniguruma's original author.

BSD-2-Clause, inherited from the Oniguruma source this port is based on.

More from Ferramenta

Ferramenta — A family of Rust tools.

Engines

Tool Job
ferriki Shiki-compatible syntax highlighting
ferromark Markdown to HTML, sanitized by default
ferrolex Spell checking for text and code
ferrocat Translation catalog engine
ferralk Glob matching and parallel filesystem walking
ferrugo PDF previews for untrusted files

Applications

Tool Job
palamedes Internationalization for TypeScript applications
dalo Your team's agent setup, versioned like code