regex_tool
Test regular expressions, extract matches with capture groups, or replace text using a pattern and replacement. Choose the action to fit your regex task.
Instructions
正则表达式测试/提取/替换。action=test 返回是否匹配;extract 返回所有匹配与捕获组;replace 用 replacement 替换
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>",
"text": "<text>"
},
"name": "regex_tool"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| flags | No | 如 g/i/m/s | g |
| action | No | test | |
| pattern | Yes | ||
| replacement | No | replace 时的替换文本($1 为捕获组) |