Skip to main content

filter_lines

Function filter_lines 

Source
pub fn filter_lines(
    lines: &[String],
    pattern: &str,
    options: FilterOptions,
) -> Result<Vec<usize>, String>
Expand description

Apply the pattern to each line. Returns the 0-indexed line numbers of every line whose match status (matches vs. invert) satisfies options.invert.

Returns Err if the pattern fails to compile. An empty pattern is treated as “match everything” (every line passes) so the TUI has a sensible default before the user types.