Expand description

Chimera is a software regular expression matching engine that is a hybrid of Hyperscan and PCRE.

The design goals of Chimera are to fully support PCRE syntax as well as to take advantage of the high performance nature of Hyperscan.

Examples

let db: Database = "/test/i".parse().unwrap();
let scratch = db.alloc_scratch().unwrap();
let mut matches = vec![];
let mut errors = vec![];

db.scan("some test data", &scratch, |id, from, to, _flags, captured| {
    matches.push((from, to));

    Matching::Continue
}, |error_type, id| {
    errors.push((error_type, id));

    Matching::Skip
}).unwrap();

assert_eq!(matches, vec![(5, 9)]);
assert_eq!(errors, vec![]);

Modules

The chimera Prelude

Structs

Structure representing a captured subexpression within a match.
Providing details of the compile error condition.
A compiled pattern database that can then be used to scan data.
A borrowed reference to a Database.
Pattern flags
The pattern with basic regular expression.
Vec of Pattern
A large enough region of scratch space to support a given database.
A borrowed reference to a Scratch.

Enums

A type for errors returned by Chimera functions.
The type of error event that occurred.
Callback return value used to tell the Chimera matcher what to do after processing this match.
Compile mode flags

Traits

The regular expression pattern database builder.
Definition of the Chimera error event callback function type.
Definition of the match event callback function type.

Functions

Compile an expression into a Chimera database.
Utility function for identifying this release version.