Macro lazy_regex::regex[][src]

regex!() { /* proc-macro */ }
Expand description

Return a lazy static Regex checked at compilation time and built at first use.

Flags can be specified as suffix:

let case_insensitive_regex = regex!("^ab+$"i);

The macro returns a reference to a regex::Regex instance:

let verbose = regex!(r#"_([\d\.]+)"#)
    .replace("This is lazy-regex_2.2", " (version $1)");
assert_eq!(verbose, "This is lazy-regex (version 2.2)");