1
2
3
4
5
6
7
8
9
10
11
12
13
use fancy_regex::Regex;

pub fn matches(string: &str, includes: &Option<Regex>, excludes: &Option<Regex>) -> bool {
	if let Some(excludes) = excludes {
		if excludes.is_match(string).unwrap() {
			return false;
		}
	}
	if let Some(includes) = includes {
		return includes.is_match(string).unwrap();
	}
	true
}