LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • 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

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
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). Binary files are skipped. If path names an exact file, only that file is considered. Returns an empty array when no matches are found or on invalid input.

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

Parameters

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