1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
mod regex;

use std::collections::BTreeSet;

use regex::dfa::DFA;
pub use regex::Regex;

pub struct CompiledRegex<I> {
    automaton: DFA<BTreeSet<usize>, I>,
}

impl<I> CompiledRegex<I> {
    pub fn is_match(&self, input: &[I]) -> bool {
        let mut a = self.automaton.clone();
        a.accept(input)
    }
}