Files @ 3cdbf505e6f8
Branch filter:

Location: Regular-Expresso/src/main.rs - annotation

3cdbf505e6f8 410 B application/rls-services+xml Show Source Show as Raw Download as Raw
Laman
replaced the Token trait with a Token enum
use regexp::Regexp;

fn main() {
	let tests = ["", "a", "ab", "aabb", "abab", "abcd", "abcbcdbcd"];
	for pattern in ["*", "((a)", "a)", "+a"] {
		println!("# {pattern}");
		let r = match Regexp::new(&pattern.to_string()) {
			Ok(r1) => r1.determinize(),
			Err(e) => {
				println!("{e}");
				continue;
			}
		};
		for &t in tests.iter() {
			println!("{t} {}", r.eval(t.to_string()));
		}
		println!();
	}
}