Function human_regex::unicode_category
source · pub fn unicode_category(category: UnicodeCategory) -> HumanRegex
Expand description
A function for matching Unicode character categories. For matching script categories see unicode_script.
use human_regex::{beginning, end, one_or_more, unicode_category, UnicodeCategory};
let regex_string = beginning()
+ one_or_more(unicode_category(UnicodeCategory::CurrencySymbol))
+ end();
assert!(regex_string.to_regex().is_match("$¥₹"));
assert!(!regex_string.to_regex().is_match("normal words"));