pub fn compile<S: Builder>(expression: S) -> Result<Database, S::Err>
Expand description

Compile an expression into a Chimera database.

Examples

let db: Database = compile(r"/foo(bar)?/i").unwrap();
let mut s = db.alloc_scratch().unwrap();

let mut matches = vec![];
db.scan("hello foobar!", &mut s, |_, from, to, _, _| {
    matches.push(from..to);
    Matching::Continue
}, |_, _|{
    Matching::Skip
}).unwrap();

assert_eq!(matches, vec![6..12]);