Compile your regular expressions at compile time.
Almost none of this has actually been implemented yet. Do not use this yet.
```rust use birdmachine::{birdmachine, Machine};
struct Date;
assert!(Date::is_match("2014-01-01")); ```
```rust use birdmachine::{birdmachine, Machine};
struct Date<'a>(&'a str, &'a str, &'a str); let input = "2012-03-14, 2013-01-01 and 2014-07-05"; let matchinfo = Date::capturesiter(input) .map(|x: Date| format!("Month: {} Day: {} Year: {}", x.1, x.2, x.0)); let expected = [ "Month: 03 Day: 14 Year: 2012", "Month: 01 Day: 01 Year: 2013", "Month: 07 Day: 05 Year: 2014", ]; for (actual, expected) in matchinfo.zip(expected) { asserteq!(actual, expected); } ```
```rust use birdmachine::{birdmachine, Machine};
struct Date<'a> { y: &'a str, m: &'a str, d: &'a str, } let before = "2012-03-14, 2013-01-01 and 2014-07-05"; let after = Date::replaceall(before, "$m/$d/$y"); asserteq!(after, "03/14/2012, 01/01/2013 and 07/05/2014"); ```
```rust use birdmachine::birdmachine;
// this will not compile
struct Bad; ```