Skip to main content

filter_lines_with_extracted

Function filter_lines_with_extracted 

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

Apply the pattern to the extracted string for each line. Lines whose extracted[i] is None are excluded from the match set regardless of whether the pattern is empty or invert is set — a missing/non-string field is not a “line” for matching purposes.

Returns the 0-indexed line numbers of the raw input that should be emitted (i.e. whose extracted value satisfies the pattern + invert flag).