Regex Explain
regex_explainExplain, lint and test a regular expression before an agent ships it. Parses the pattern (PCRE, JavaScript, Python, Go/RE2, Java or .NET syntax) into a token-by-token plain-English explanation with capture groups; flags ReDoS risks (nested quantifiers, overlapping alternation in repeats, adjacent overlapping quantifiers) and confirms them with a crafted input against a backtracking limit; warns about common bugs (unescaped dots in domains, [A-z], empty alternatives, unanchored validators); reports which features each regex flavour does not support (lookbehind, possessive / atomic, \A \z, named-group syntax, Unicode classes, backreferences in RE2); and runs the pattern on sample strings returning every match with its groups and offsets. Price: $0.002 USDC per successful call (x402, Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/regex-explain
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>"
},
"name": "regex_explain"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flags | No | i, m, s, x, u (g and y are accepted and ignored) | |
| tests | No | Sample strings to run the pattern on | |
| flavor | No | pcre | |
| pattern | Yes | The regex (a JavaScript literal like /abc/gi is also accepted) |