// Parameter `pattern` is the expected response pattern defined in `test.toml`.
// We invalidate all regex meta characters by escaping the pattern string.
// Then we empower character `*` (already escaped to `\\*`) with a special meaning as regex meta `.*`.
Parameter `pattern` is the expected response pattern defined in `test.toml`.
We invalidate all regex meta characters by escaping the pattern string.
Parameter ` pattern ` is the expected response pattern defined in ` test . toml ` . We invalidate all regex meta characters by escaping the pattern string .
fn create_wildcard_regex(pattern: &str) -> Result<Regex, ExitFailure> {
    let escaped_pattern = regex::escape(&pattern.trim());
    let p = escaped_pattern.replace("\\*", ".*");
    Ok(Regex::new(&p)?)
}
fn create_wildcard_regex ( pattern : & str ) -> Result < Regex , ExitFailure > { let escaped_pattern = regex :: escape ( & pattern . trim ( ) ) ; let p = escaped_pattern . replace ( " \\ " , " " ) ; Ok ( Regex :: new ( & p ) ? ) }
Parameter `pattern` is the expected response pattern defined in `test.toml`.
Parameter ` pattern ` is the expected response pattern defined in ` test . toml ` .
pattern
&str