search_file
Find regex patterns in a file and display matching lines with specified context lines before and after each match for precise file analysis.
Instructions
Search for regex patterns in a file and show matching lines with context.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
file_path | Yes | Absolute path to the file | |
lines_after | No | Number of lines to show after each match | |
lines_before | No | Number of lines to show before each match | |
regexp | Yes | Regular expression pattern to search for |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"file_path": {
"description": "Absolute path to the file",
"type": "string"
},
"lines_after": {
"description": "Number of lines to show after each match",
"minimum": 0,
"type": "integer"
},
"lines_before": {
"description": "Number of lines to show before each match",
"minimum": 0,
"type": "integer"
},
"regexp": {
"description": "Regular expression pattern to search for",
"type": "string"
}
},
"required": [
"file_path",
"regexp"
],
"type": "object"
}