macro_rules! assert_matches_regex {
    ($s:expr, $regex:expr) => { ... };
    ($s:expr, $regex:expr, $description:expr) => { ... };
}
Expand description

Asserts that passed &str matches a regular expression. Regular expressions are compiled using regex crate.

use k9::assert_matches_regex;

assert_matches_regex!("1234-45", "\\d{4}-\\d{2}");
assert_matches_regex!("abc", "abc");