Macro pact_consumer::matching_regex

source ยท
macro_rules! matching_regex {
    ($regex:expr, $example:expr) => { ... };
}
Expand description

A pattern which matches the regular expression $regex (specified as a string) literal, and which generates $example.

use pact_consumer::*;

json_pattern!({
  // Match a string consisting of numbers and lower case letters, and
  // generate `"10a"`.$crate::patterns::
  "id_string": matching_regex!("^[0-9a-z]$", "10a")
});