# grep_matches_from_files

> **Function** in `deepagents`

📖 [View in docs](https://reference.langchain.com/python/deepagents/backends/utils/grep_matches_from_files)

Return structured grep matches from an in-memory files mapping.

Performs literal text search (not regex).

Returns a GrepResult with matches on success.
We deliberately do not raise here to keep backends non-throwing in tool
contexts and preserve user-facing error messages.

## Signature

```python
grep_matches_from_files(
    files: dict[str, Any],
    pattern: str,
    path: str | None = None,
    glob: str | None = None,
) -> GrepResult
```

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/1ae053f347679e58562d2b81eb6d6e6e9bbf0b07/libs/deepagents/deepagents/backends/utils.py#L692)