Regex tester: matches, groups, replace and split (JavaScript flavor) ($0.002/call)
regex_test$0.002 per call (x402, USDC on Base; free trial: add "trial": true or use try_free). [Data utilities] Runs a JavaScript (ECMAScript) regular expression on your text and returns every match with index, line, column, numbered and named groups, or the result of replace or split. Catastrophic patterns are stopped after 3 seconds and not charged. Input: pattern (or /pattern/flags), text, optional flags, mode, replace, max_matches (POST for long text). Limits: 2,000-character pattern, 400,000-character text. Offline.
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_test"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | match (all matches with groups, default), test (first match only), replace or split | match |
| text | Yes | Text to run the regex on, up to 400,000 characters (POST for long text) | |
| flags | No | Regex flags, e.g. gi (or write the pattern as /.../flags) | |
| trial | No | Optional. true = free if a trial call is left (3 per IP per UTC day), else the payment terms. | |
| pattern | Yes | JavaScript regular expression, up to 2,000 characters, either the bare pattern or /pattern/flags | |
| replace | No | Replacement for mode=replace ($1, $<name>, $&; default empty = delete matches) | |
| max_matches | No | Matches to list, 1-1000 (default 100) | 100 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | ||
| tool | No | ||
| cache | No | ||
| flags | No | ||
| notes | No | ||
| parts | No | ||
| _trial | No | Present when the call was a free trial call. | |
| flavor | No | ||
| result | No | ||
| matched | No | ||
| matches | No | ||
| pattern | No | ||
| provider | No | ||
| price_usd | No | ||
| truncated | No | ||
| group_count | No | ||
| group_names | No | ||
| match_count | No | ||
| replaced_count | No |