grep
Search for text patterns in files using regular expressions, recursively explore directories, and filter results based on file exclusions, while respecting .gitignore and file permissions.
Instructions
Search for text patterns inside files using regular expressions.
Args: dir (str): Directory to search in (absolute or relative to allowed directories) pattern (str): Regular expression pattern to search for in file contents exclude (str, optional): File pattern to exclude from search
Returns: str: Newline-separated matches in format 'path:lineNo: line', or error message if failed
Note:
Input Schema
Name | Required | Description | Default |
---|---|---|---|
dir | Yes | ||
exclude | No | ||
pattern | Yes |