pub trait ReplaceRegex {
// Required method
fn replace_regex<'a>(
&'a self,
regex: &str,
replacement: &str,
) -> Result<Cow<'a, str>, RegexError>;
}Required Methods§
Sourcefn replace_regex<'a>(
&'a self,
regex: &str,
replacement: &str,
) -> Result<Cow<'a, str>, RegexError>
fn replace_regex<'a>( &'a self, regex: &str, replacement: &str, ) -> Result<Cow<'a, str>, RegexError>
Extension method for &str, that replaces all instances of a regex with a replacement string
§Errors
If the regex fails to compile