Skip to main content

grep_search

Function grep_search 

Source
pub fn grep_search(
    pattern: &str,
    path: &str,
    recursive: bool,
    max_matches: usize,
    offset: usize,
) -> GrepSearchResult
Expand description

Standalone function for grep search (for use in tests and other modules)

§Arguments

  • pattern - Regex pattern to search for
  • path - File or directory to search in
  • recursive - Whether to search recursively
  • max_matches - Maximum number of matches to return
  • offset - Number of matches to skip

§Returns

A GrepSearchResult containing matches and metadata