regexpr

Trait ReplaceRegex

Source
pub trait ReplaceRegex {
    // Required method
    fn replace_regex<'a>(
        &'a self,
        regex: &str,
        replacement: &str,
    ) -> Result<Cow<'a, str>, RegexError>;
}

Required Methods§

Source

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

Implementations on Foreign Types§

Source§

impl ReplaceRegex for &str

Source§

fn replace_regex<'a>( &'a self, regex: &str, replacement: &str, ) -> Result<Cow<'a, str>, RegexError>

Implementors§