aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 6b4612d0be97fc29a2635ed23c454219caf7ff7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
mod nfa;
mod regex;
use nfa::*;
use regex::*;

fn test(regex: &str, input: &str) -> bool {
    let token = Regex::new(String::from(regex));
    let mut nfa = NFA::new();
    nfa.regex_to_nfa(token);
    nfa.matches(String::from(input))
}

fn main() {
    // println!("{}", test("a.b..", "a.bxb"));
    println!("{}", test(".b", "ab"))
}