Macro const_str::verified_regex
source · macro_rules! verified_regex { ($re: literal) => { ... }; }
Available on crate feature
regex
only.Expand description
Returns a compile-time verified regex string literal.
§Examples
use regex::Regex;
let re = const_str::verified_regex!(r"^\d{4}-\d{2}-\d{2}$");
assert!(Regex::new(re).is_ok());