regex_replace
Find and replace text using regular expressions with capture group references ($1, $2, $&) in the replacement string.
Instructions
Find and replace text using a regex pattern. Supports capture group references ($1, $2, etc.) in the replacement string.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pattern": "<pattern>",
"input": "<input>",
"replacement": "<replacement>"
},
"name": "regex_replace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | Regular expression pattern to match | |
| input | Yes | Text to perform replacement on | |
| replacement | Yes | Replacement string. Use $1, $2 for capture groups, $& for full match. | |
| flags | No | Regex flags. Default: g (global) |