Macro const_str::verified_regex
source · [−]macro_rules! verified_regex {
($re: literal) => { ... };
}
Expand description
Returns a compile-time verified regex string literal.
This macro requires the feature verify-regex
.
Examples
use regex::Regex;
let re = const_str::verified_regex!(r"^\d{4}-\d{2}-\d{2}$");
assert!(Regex::new(re).is_ok());