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
patternstring-
The regular expression pattern to search for.
pathstring?-
The file or directory to search, or the working directory when omitted.
includestring?-
An optional glob filter, such as
*.cs. output_modestring-
The output mode:
files_with_matches,content, orcount. context_linesint-
The number of surrounding lines to include for content output.
limitint-
The maximum number of results to return.
Returns
- string
-
A newline-delimited search result, or a no-match message.