rexify 0.2.0

trait based matcher alternative to Regex
Documentation
  • Coverage
  • 94.44%
    34 out of 36 items documented14 out of 29 items with examples
  • Size
  • Source code size: 21.37 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 848.06 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • kntt32/rexify
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kntt32

🍵 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