Function human_regex::and

source ·
pub fn and<T>(options: &[T]) -> HumanRegexwhere
    T: Into<String> + Display,
Expand description

A function for establishing an AND relationship between two or more possible matches

use human_regex::{text, and, or, within};
let regex_string = and(&vec![within('a'..='y'),or(&['x','y','z'])]);
println!("{}", regex_string);
assert!(regex_string.to_regex().is_match("x"));
assert!(regex_string.to_regex().is_match("y"));
assert!(!regex_string.to_regex().is_match("z"));