This crate contains a little macro to generate a lazy
Regex
and remove some
boilerplate when compiling regex expressions.
Generally you want to avoid compiling a regex multiple times. The regex
crate suggests using lazy_static
for this but you can also use once_cell
which is what this crate uses. For example:
```rust use regex_macro::regex;
let re = regex!("[0-9a-f]+"); assert!(re.is_match("1234deadbeef")); ```
Which is equivalent to the following.
```rust use once_cell::sync::Lazy; use regex::Regex;
let re = {
static RE: Lazy
Licensed under either of
at your option.