ferroni 2.1.2

Oniguruma's regex engine in pure Rust: full Oniguruma syntax, a vscode-oniguruma-compatible TextMate scanner, no C toolchain
Documentation
<!-- This file is generated by mdtheme. Edit README.md.src instead. -->

Part of [Ferramenta](https://ferramenta.dev), a family of Rust tools.

# Ferroni — Oniguruma's regex engine, modernized in Rust

[![Powered by Sebastian Software](https://img.shields.io/badge/Powered_by-Sebastian_Software-005164?style=flat)](https://oss.sebastian-software.com) [![crates.io](https://img.shields.io/crates/v/ferroni?style=flat-square&logo=rust&label=crates.io)](https://crates.io/crates/ferroni)
[![docs.rs](https://img.shields.io/docsrs/ferroni?style=flat-square&logo=docsdotrs&label=docs.rs)](https://docs.rs/ferroni)
[![CI](https://img.shields.io/github/actions/workflow/status/sebastian-software/ferroni/ci.yml?branch=main&style=flat-square&logo=github&label=CI)](https://github.com/sebastian-software/ferroni/actions)
[![Coverage gate at least 87 percent](https://img.shields.io/badge/coverage%20gate-%E2%89%A5%2087%25-blue?style=flat-square)](https://github.com/sebastian-software/ferroni/blob/main/.github/workflows/ci.yml)
[![MSRV 1.94](https://img.shields.io/badge/MSRV-1.94-blue?style=flat-square&logo=rust)](CONTRIBUTING.md#getting-started)
[![License](https://img.shields.io/badge/license-BSD--2--Clause-blue?style=flat-square)](https://github.com/sebastian-software/ferroni/blob/main/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 →](https://ferroni.dev)** — matching examples, a visual
scanner walkthrough, compatibility evidence and measured performance.

## Quick start

```bash
cargo add ferroni
```

```rust
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](https://ferroni.dev/guide/compatibility)
and [untrusted input](https://ferroni.dev/guide/untrusted-input).

When your patterns fit Rust's [`regex`](https://crates.io/crates/regex)
crate, prefer its guaranteed linear-time matching.

## Documentation

- [Getting started]https://ferroni.dev/guide/getting-started — captures, iteration, options, errors and the Scanner API.
- [API reference]https://docs.rs/ferroni — every public type and function.
- [Benchmarks]https://ferroni.dev/perf/engine-comparison — workloads, comparison engines, measurement conditions and raw data.
- [Migrating to 2.0]https://ferroni.dev/guide/migrating-to-2 — 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](https://ferroni.dev/#project-status) for
maintenance scope and contribution opportunities.

[CONTRIBUTING.md](CONTRIBUTING.md) covers builds, tests and benchmarks;
[architecture decisions](https://ferroni.dev/adr/001-one-to-one-parity-with-c-original)
define the port's constraints. Report vulnerabilities privately as described
in [SECURITY.md](SECURITY.md).

## Acknowledgments and license

Built on [K. Kosako's Oniguruma](https://github.com/kkos/oniguruma) and
Microsoft's [vscode-oniguruma](https://github.com/microsoft/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](LICENSE), inherited from the Oniguruma source this port is
based on.

### <a href="https://ferramenta.dev"><img src="https://raw.githubusercontent.com/sebastian-software/ferramenta/main/app/assets/brand/logo-light.svg" width="24" height="24" alt="" /> More from Ferramenta</a>

[Ferramenta](https://ferramenta.dev) — A family of Rust tools.

**Engines**

| Tool | Job |
| --- | --- |
| [ferriki]https://ferriki.dev | Shiki-compatible syntax highlighting |
| [ferromark]https://ferromark.dev | Markdown to HTML, sanitized by default |
| [ferrolex]https://github.com/sebastian-software/ferrolex | Spell checking for text and code |
| [ferrocat]https://ferrocat.dev | Translation catalog engine |
| [ferralk]https://github.com/sebastian-software/ferralk | Glob matching and parallel filesystem walking |
| [ferrugo]https://github.com/sebastian-software/ferrugo | PDF previews for untrusted files |

**Applications**

| Tool | Job |
| --- | --- |
| [palamedes]https://palamedes.dev | Internationalization for TypeScript applications |
| [dalo]https://dalo.sh | Your team's agent setup, versioned like code |

---

<p align="center">
  <a href="https://oss.sebastian-software.com"><img src="https://raw.githubusercontent.com/sebastian-software/oss.sebastian-software.com/main/app/assets/logo-software.svg" alt="Sebastian Software" width="160" /></a><br />
  TypeScript, React &amp; Rust consulting<br />
  Experts in Agentic Software Development<br />
  <a href="https://sebastian-software.de">Work with us</a> · <a href="https://oss.sebastian-software.com">More open source</a>
</p>

<p align="center">Copyright &copy; 2026 Sebastian Software GmbH</p>