Function human_regex::text

source ·
pub fn text<T>(text: T) -> HumanRegexwhere
    T: Into<String> + Display,
Expand description

Add matching text to the regex string. Text that is added through this function is automatically escaped.

let regex_string = human_regex::text("asdf");
assert!(regex_string.to_regex().is_match("asdf"));
assert!(!regex_string.to_regex().is_match("asddf"));