LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Configuration
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsConfigurationTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsbackendsgrepMatchesFromFiles
Function●Since v1.4

grepMatchesFromFiles

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

Performs literal text search (not regex).

Returns a list of GrepMatch on success, or a string for invalid inputs. We deliberately do not raise here to keep backends non-throwing in tool contexts and preserve user-facing error messages.

Copy
grepMatchesFromFiles(
  files: Record<string, FileData>,
  pattern: string,
  path: string | null = null,
  glob: string | null = null
): string | GrepMatch[]

Parameters

NameTypeDescription
files*Record<string, FileData>
pattern*string
pathstring | null
Default:null
globstring | null
Default:null
View source on GitHub