pub fn replacement_if_match(
line: &str,
search: &SearchType,
replace: &str,
) -> Option<String>Expand description
Performs a search and replace operation on a string if the pattern matches
§Arguments
line- The string to search withinsearch- The search pattern (fixed string, regex, or advanced regex)replace- The replacement string
§Returns
Some(String)containing the string with replacements if matches were foundNoneif no matches were found