pub fn with_pattern_from_str<T>(re: &Regex, s: &str) -> Result<T, Error>where
    T: DeserializeOwned,