hyperscan 0.2.0

Hyperscan bindings for Rust with Multiple Pattern and Streaming Scan
docs.rs failed to build hyperscan-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: hyperscan-0.1.8

Hyperscan is a high-performance regular expression matching library.


This crate is on crates.io and can be used by adding hyperscan to your dependencies in your project's Cargo.toml.

hyperscan = "0.2"


extern crate hyperscan;

use hyperscan::prelude::*;

fn main() {
let pattern = pattern! {"test"; CASELESS | SOM_LEFTMOST};
let db: BlockDatabase = pattern.build().unwrap();
let scratch = db.alloc_scratch().unwrap();

db.scan("some test data", &scratch, |id, from, to, _flags| {
assert_eq!(id, 0);
assert_eq!(from, 5);
assert_eq!(to, 9);

println!("found pattern {} : {} @ [{}, {})", id, pattern.expression, from, to);