Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use regex::Regex;

pub fn check_regex(content: &str, regex: &str) -> bool {
    let regex = Regex::new(regex).unwrap();
    return regex.is_match(content);
}

pub fn check_regexes(content: &str, regexes: Vec<&str>) -> bool {
    for regex in regexes {
        let regex = Regex::new(regex).unwrap();
        if regex.is_match(content) {
            return true;
        }
    }
    return false;
}