Function pretty_regex::word
source · pub fn word() -> PrettyRegex<CharClass<Standard>>
Expand description
Matches word character class (\w
) - any alphanumeric character or underscore (_
).
Example
assert!(word().to_regex_or_panic().is_match("a"));
assert!(word().to_regex_or_panic().is_match("2"));
assert!(word().to_regex_or_panic().is_match("_"));
assert!(!word().to_regex_or_panic().is_match("?"));