regex

Macro regex 

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

Compile-time validated regex pattern.

Creates a lazily-initialized regex::Regex that is validated at compile time. Invalid regex patterns will cause a compilation error.

§Examples

use rust_expect_macros::regex;

// Valid regex - compiles successfully
let prompt = regex!(r"^\w+@\w+:\S+\$\s*$");

// Invalid regex - compilation error
// let bad = regex!(r"[invalid");