Skip to main content
Glama

regexreplace

Perform regex find-and-replace operations across files while preserving original encoding. Supports single files or directories with glob filtering, capture group replacements, and preview mode.

Instructions

Performs regex find-and-replace across files. Encoding-aware: preserves original file encoding. Supports single file or recursive directory mode with glob filtering. Supports capture group replacement ($1, $2, ${name}). Skips binary files. Use dry_run=true to preview changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYesRegular expression pattern to search for
replacementYesReplacement string. Supports $1, $2 capture groups
pathYesFile or directory to process (absolute path)
globNoGlob pattern to filter files when path is a directory (e.g. *.go). Only used when path is a directory
ignore_caseNoCase insensitive search (default false)
dry_runNoPreview changes without modifying files (default false)
max_filesNoMaximum number of files to process in directory mode. Default: 100

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/knewstimek/agent-tool'

If you have feedback or need assistance with the MCP directory API, please join our Discord server