Table of Contents

Method Grep

Namespace
Oscova.Agents.Toolsets
Assembly
Oscova.Agents.dll

Grep(string, string?, string?, string, int, int)

Searches text files for a regular expression and returns matching files, counts, or content snippets.

public string Grep(string pattern, string? path = null, string? include = null, string output_mode = "files_with_matches", int context_lines = 0, int limit = 100)

Parameters

pattern string

The regular expression pattern to search for.

path string?

The file or directory to search, or the working directory when omitted.

include string?

An optional glob filter, such as *.cs.

output_mode string

The output mode: files_with_matches, content, or count.

context_lines int

The number of surrounding lines to include for content output.

limit int

The maximum number of results to return.

Returns

string

A newline-delimited search result, or a no-match message.