regex_search_content
Search file content recursively using a regex pattern. Scan subdirectories from a specified path, return matching files with line details. Optional filters: file pattern, depth, size, and result limits. Works within secure directories.
Instructions
Recursively search file content using a regex pattern. Searches through subdirectories from the starting path. Returns a list of files containing matches, including line numbers and matching lines. Requires regex
pattern. Optional: path
, filePattern
, maxDepth
, maxFileSize
, maxResults
. Only searches within allowed directories.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
filePattern | No | Glob pattern to filter files to search within (e.g., "*.ts", "data/**.json"). Defaults to searching all files. | * |
maxDepth | No | Maximum directory depth to search recursively. Defaults to 2. | |
maxFileSize | No | Maximum file size in bytes to read for searching. Defaults to 10MB. | |
maxResults | No | Maximum number of files with matches to return. Defaults to 50. | |
path | Yes | Directory path to start the search from. | |
regex | Yes | The regular expression pattern to search for within file content. |