pub fn replace_all_if_match(
line: &str,
search: &SearchType,
replace: &str,
) -> Option<String>Expand description
Calculate replacement text for a line containing matches.
This is used in line-mode search where we replace ALL occurrences of the pattern on the line(s). Returns the full line content with all matches replaced.
For both fixed and pattern searches, this uses replace_all semantics.
§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 ALL replacements if matches were foundNoneif no matches were found