2 releases

0.1.1 Sep 9, 2020
0.1.0 Aug 31, 2020
Download history 7/week @ 2020-12-25 62/week @ 2021-01-01 88/week @ 2021-01-08 19/week @ 2021-01-15 18/week @ 2021-01-22 16/week @ 2021-01-29 11/week @ 2021-02-05 172/week @ 2021-02-12 194/week @ 2021-02-19 16/week @ 2021-02-26 10/week @ 2021-03-05 200/week @ 2021-03-12 89/week @ 2021-03-19 160/week @ 2021-03-26 17/week @ 2021-04-02 13/week @ 2021-04-09

216 downloads per month
Used in 2 crates

MIT/Apache

7KB

regex-macro

Crates.io Version Docs.rs Latest Build Status

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::try_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.

Dependencies

~1–1.4MB
~40K SLoC