Function human_regex::whitespace

source ·
pub fn whitespace() -> HumanRegex
Expand description

A constant for the whitespace character class (i.e., space and tab)

use human_regex::{one_or_more, text, whitespace};
let regex_string = text("at") + one_or_more(whitespace()) + text("least");
assert!(!regex_string.to_regex().is_match("atleast"));
assert!(regex_string.to_regex().is_match("at least"));
assert!(regex_string.to_regex().is_match("at    least"));