find_in_file
Search for specific patterns within a file using regular expressions, including optional context lines for better match visibility.
Instructions
Find occurrences of a pattern in a file
Input Schema
Name | Required | Description | Default |
---|---|---|---|
contextLines | No | Number of context lines to include before and after matches (default: 2) | |
path | Yes | Path to the file to search in | |
pattern | Yes | Regular expression pattern to search for |
Input Schema (JSON Schema)
{
"properties": {
"contextLines": {
"description": "Number of context lines to include before and after matches (default: 2)",
"type": "number"
},
"path": {
"description": "Path to the file to search in",
"type": "string"
},
"pattern": {
"description": "Regular expression pattern to search for",
"type": "string"
}
},
"required": [
"path",
"pattern"
],
"type": "object"
}