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
JavaScriptdeepagentsindexBackendProtocolV2grep
Method●Since v1.8

grep

Copy
grep(
  pattern: string,
  path: string | null,
  glob: string | null
): MaybePromise<GrepResult
View source on GitHub
>

Parameters

NameTypeDescription
pattern*string
pathstring | null
globstring | null

Search file contents for a literal text pattern.

Binary files (determined by MIME type) are skipped.

Literal text pattern to search for

Base path to search from (default: null)

Optional glob pattern to filter files (e.g., "*.py")