Macro plexer::regex

source ·
macro_rules! regex {
    ($pattern:literal) => { ... };
    (@safe $pattern:literal) => { ... };
}
Expand description

Macro to build a Regex.

Panics

If the given pattern is not @safe and not a valid regex.

let err = regex!("(");

Example

// Unwrap inside the macro
let re = regex!("t|e|s|t");
// Don't unwrap
let gex = regex!(@safe "t|e|s|t").unwrap();