Function human_regex::nor

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

Negated or relationship between two or more possible matches

use human_regex::{text, nor};
let regex_string = text("gr") + nor(&[text("a"), text("e")]) + text("y");
println!("{}", regex_string.to_string());
assert!(!regex_string.to_regex().is_match("grey"));
assert!(!regex_string.to_regex().is_match("gray"));
assert!(regex_string.to_regex().is_match("groy"));