regex_static
Compile-time validation of regex::Regex
.
Examples
Lazy regex
Uses once_cell
to lazily create the regex.
static RE: = lazy_regex!;
Static regex
Also uses once_cell
, but works inline (will therefore reuse the same instance of the regex each function call).
let some_regex = static_regex!;
Ordinary regex
Will create an owned Regex
, just like calling Regex::new(...)
but with compile-time validation.
let ordinary_regex = regex!;