Regex Explainer

Explain a regex in plain English and detect catastrophic backtracking risk.

我该使用它吗

质量与安全性

A
描述质量
100%
模式完整度
100%
命名质量
80%
投毒风险
100%
权限匹配度
100%
协议合规性
100%

基于对工具定义和协议合规性的自动分析。

上下文开销

~424token 数(工具定义)
~828 B典型响应大小
对注意力的影响极小(占 128k 上下文窗口的 0.33%)

这是每次将服务器的工具加载到模型上下文窗口时所消耗的大致 token 数。数值越高,可用于其他任务的注意力就越少。

安装

一键安装

将以下内容添加到你的 `claude_desktop_config.json` 文件中:

{
  "mcpServers": {
    "regex-explainer": {
      "url": "https://regex-explainer.gumballtools.com/api/mcp"
    }
  }
}

远程端点

https://regex-explainer.gumballtools.com/api/mcpstreamable-http

它能做什么

工具清单

工具(1)

🟢 只读🟡 写入🔴 删除⚪ 未知
🟢explain_regex(pattern)

Explain a regular expression in plain English and detect the failure modes that make patterns dangerous rather than merely wrong. Use this whenever a regex needs to be read, reviewed, or verified — and ALWAYS before putting a pattern somewhere it will run against untrusted input. The critical check is catastrophic backtracking: a pattern like (a+)+$ is three characters longer than a safe equivalent, looks harmless, and takes minutes of CPU on a 30-character input that almost matches. That makes it a denial-of-service vector. Whether a pattern is vulnerable depends on whether nested quantifiers can match the same characters in more than one way, which is a structural property that is unreliable to judge by reading. It also flags: missing anchors (an unanchored validator accepts any string that merely CONTAINS a valid value), unescaped dots, character ranges like [A-z] that span punctuation, alternation precedence mistakes where an anchor applies to only one branch, and constructs JavaScript does not support. Input: `pattern` accepts either a bare pattern or a full /pattern/flags literal. JavaScript syntax; PCRE-only constructs are reported as unsupported rather than guessed at. Returns: `summary` (one sentence), `steps` (an ordered walkthrough), `warnings` (each with a code, severity, detail, and fix), `flagNotes`, capture group counts and names, and `hasBlockingIssue` — check that flag first. If the pattern cannot be parsed it returns an error naming the position, rather than a plausible-looking explanation of something else.

输入模式

{
  "type": "object",
  "properties": {
    "pattern": {
      "type": "string",
      "description": "A JavaScript regular expression, either bare (\"^\\d+$\") or as a full literal (\"/^\\d+$/gi\"). Up to 2000 characters."
    }
  },
  "required": [
    "pattern"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}

社区

评价此服务器

证据

最近观测

已验证未记录版本1 个工具
已验证未记录版本1 个工具