rexify

Crates.iorexify
lib.rsrexify
version0.2.0
created_at2025-08-25 06:18:54.969607+00
updated_at2025-08-25 07:19:44.038862+00
descriptiontrait based matcher alternative to Regex
homepagehttps://github.com/kntt32/rexify
repositoryhttps://github.com/kntt32/rexify
max_upload_size
id1809098
size21,379
knt.t (kntt32)

documentation

README

🍵 Rexify

Trait-driven matcher library for Rust - expressive, composable, and extendable!

⚡ What is Rexify?

Rexify enables Rustaceans to define matchers using a trait based approach, offering a more type-safe, descriptive, and extensible alternative to traditional regex. It empowers you to create text parsers with ease.

🔎 Highlights

  • Modular & Extensible: Compose custom patterns by implementing the Matcher trait.
  • Rust-Native Design: Leverages trait objects, ownership and lifetime for safe and efficient matching.

📦 Intallation

Add rexify to your Cargo.toml:

[dependencies]
rexify = "0.2.0"

🔧 Examples

use rexify::Rex;
use rexify::Matcher;
use rexify::number::Number;
//! use rexify::any_char::AnyChar;
//! use rexify::repeats::Repeat1;
//!
//! let rex = Rex::new(vec![
//!     Box::new(Number::new()),
//!     Box::new(Repeat1::new(AnyChar::new())),
//! ]);
//! let text = "asdija123102abc";
//!
//! assert_eq!(rex.find(text), Some(6));
//! assert_eq!(rex.capture(&text[6 ..]), Some((9, vec!["123102", "a", "b", "c"])));
//! ````

## ⚖️ Lisence
MIT Lisence

Commit count: 4

cargo fmt