regex-macro 0.1.0

A macro to generate a lazy Regex.
Documentation

regex-macro

This crate contains a little macro to generate a lazy Regex and remove some boilerplate when compiling regex expressions.

Usage

The following panics when given a bad regex.

use regex_macro::regex;

let re = regex!("[0-9a-f]+");

The following errors when given a bad regex.

use regex_macro::regex;

let re = try_regex!("[0-9a-f]+").expect("bad regex");

// or propagate

let re = try_regex!("[0-9a-f]+")?;

License

Licensed under either of

at your option.