Skip to main content

Crate javelin_pattern

Crate javelin_pattern 

Source
Expand description

Rust bindings to Jeffrey Lim’s JavelinPattern.

The bytes module matches byte slices and reports byte offsets. Compilation is fallible; matching and scanning follow the native engine’s semantics.

use javelin_pattern::bytes::Regex;

let re = Regex::new(r"(\w+)=(\d+)")?;
let captures = re.captures(b"answer=42").unwrap();
assert_eq!(captures.get(1).unwrap().as_bytes(), b"answer");
assert_eq!(captures.get(2).unwrap().as_bytes(), b"42");

Modules§

bytes
Regular expressions over byte slices. All match offsets are measured in bytes.

Enums§

Error
An error compiling a regular expression.