GitHub
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
作者提供的说明(英文原文)
Extract regular expressions from code, each with a ReDoS safety verdict.
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"regex-le": {
"command": "npx",
"args": [
"-y",
"regex-le-mcp"
]
}
}
}在终端中运行这条命令
claude mcp add regex-le -- npx -y regex-le-mcp粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"regex-le": {
"command": "npx",
"args": [
"-y",
"regex-le-mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"regex-le": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"regex-le-mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月8日
注册名称已通过 GitHub 账户 nolindnaidoo 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(2.6.0)于31天前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
同一分类中有:GitHub, Desktop Commander, Cloudflare MCP
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
MCP server for terminal commands, file operations, and process management
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Regex-LE: Zero Hassle Regex Extraction & Validation
Find, test, and validate the regex patterns in the current file
Literal patterns, RegExp constructors, ReDoS screening
Useful? A star or rating is how other developers find it —
★ GitHub ·
Open any file and run one of three commands. Extract lists every regex pattern found in the document. Test runs a found — or manually entered — pattern against the file content and reports matches with real line/column positions and capture groups (named groups included). Validate checks every found pattern for syntax errors and screens it for catastrophic backtracking, reporting the input that causes it. Works in VS Code and VS Code–based editors like Cursor and VSCodium (installable from Open VSX).
| Where | What you get | Install |
|---|---|---|
| VS Code | The lint *and* the tester, in your editor | Marketplace |
| Cursor, VSCodium, Windsurf | The same extension | Open VSX |
| A terminal or a CI step | The same run over a whole tree, with exit codes | cargo install regex-le · crates.io |
| A terminal, via Node | The same command line, held to the Rust one byte for byte | npx regex-le · npm |
| Any MCP agent, via Node | extract_patterns over stdio | npx regex-le-mcp · npm |
The same engine runs as an MCP server, so an agent can call it directly instead of you running a command.
| Editor | How |
|---|---|
| VS Code 1.101+ | Nothing to install — the extension registers extract_patterns with agent mode |
| Claude Code | claude mcp add regex-le -- npx -y regex-le-mcp |
| Cursor, Windsurf, anything else | point it at npx regex-le-mcp |
extract_patterns(content, format?, filename?, maxResults?)
Returns every pattern with its flags, 1-based position and a ReDoS verdict, so "are any of the regexes in this file dangerous?" is one call rather than two. A verdict that reports a blow-up carries the witness that caused it, so an agent can check the finding instead of trusting it.
The server takes content and returns data — it reads no files and makes no network requests of its own. Published as regex-le-mcp on npm and as io.github.nolindnaidoo/regex-le in the MCP registry.
Configuring it by hand — any host with an MCP config file
Most hosts read a JSON config. Add one entry:
{
"mcpServers": { "regex-le": { "command": "npx", "args": ["-y", "regex-le-mcp"] } } }
-y skips the install prompt on first run. Pin a version if you would rather not track releases — regex-le-mcp@2.6.0.
Prefer not to go through npx on every launch? Install it once and point at the binary instead:
npm install -g regex-le-mcp
{
"mcpServers": { "regex-le": { "command": "regex-le-mcp" } } }
It speaks MCP over stdio and needs no environment variables, no API key and no configuration of its own. To check it before wiring it into anything:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | npx -y regex-le-mcp
That prints the tool list and exits — if you see extract_patterns, the server works.
Extraction scans the whole document, so constructors split across lines are found too. The document's language chooses which spellings to look for:
| Language | Form | Example | |
|---|---|---|---|
| JavaScript, TypeScript, Ruby | Literal | /[a-z]+/gi | |
| JavaScript, TypeScript | Constructor | new RegExp('\\d{4}-\\d{2}', 'g') — including multiline | |
| JavaScript, TypeScript | Bare constructor call | `RegExp("x\ | y", "i")` |
| Python | re.compile and friends | re.compile(r'(a+)+') | |
| Rust | Regex::new, RegexBuilder::new | Regex::new(r"(a+)+") | |
| Go | regexp.MustCompile, regexp.Compile | regexp.MustCompile(`(a+)+`) | |
| Java | Pattern.compile, Pattern.matches | Pattern.compile("(a+)+") | |
| Ruby | Regexp.new | Regexp.new('(a+)+') | |
| PHP | preg_match and friends | preg_match('/(a+)+/i', $s) | |
| C# | new Regex(…), Regex.IsMatch and friends | new Regex(@"(a+)+") |
A language nothing recognises is not a refusal — every spelling above is looked for. Naming it buys precision: a Python file is not scanned for bare /…/, so #!/usr/bin/env python stops reading as a pattern.
What is deliberately not extracted:
a / b, 10/29/2025, /usr/local/bin): a / preceded by an identifier, number, ), ], ., or another / is not treated as a regex — after keywords like return, it is. That question is only asked where a bare /…/ is legal.re.compile(r'(?P \w+)+@') is reported as written, and still flagged.${…} substitution. String literals, static template literals and String.raw`…` are read.(?i) rather than a string argument.re.compile(r"(a+)+b") keeps its quoted argument while a docstring holding that whole line is prose. Only when the language is known: a document nothing recognises is scanned as written, because a comment rule guessed from the wrong grammar would drop real patterns instead of phantom ones.Duplicate pattern+flags pairs are listed once. This is lexing by heuristic, not a parser for nine languages: a slash inside a string can still be picked up when its context looks expression-like.
Validate (and Test, before running a risky pattern) reports a pattern only when an input was found that demonstrably drives it into catastrophic backtracking — and reports that input alongside it, as the witness.
Your pattern is never run. It is compiled to an automaton, and that automaton is walked the way a backtracking engine walks one — depth-first, every edge in order, a dead end unwound rather than remembered — while the steps are counted. An attack string is built, pumped at two lengths, and measured against a step budget. So a finding is falsifiable: run the witness and watch.
Nothing is reported on the strength of how a pattern is *shaped*. Shape is a poor predictor in both directions: ^[a-z0-9]+(?:-[a-z0-9]+)*$ looks dangerous and is not, because every iteration must eat a - the inner class cannot produce, while (.*a){20} looks bounded and is not. A separator forcing the split is a fact about strings, so no test on syntax settles it.
Silence is not a clearance. A pattern this cannot read — a backreference, lookaround, syntax it does not parse — comes back as not decided: , never as safe.
The reports also include a rough performance score based on execution time relative to input size — treat it as a hint, not a benchmark (memory is not measured).
Extract and Validate read the document you have open. Each has a form that reads many files from disk and gives one report.
Regex-LE: Extract Patterns from Workspace or Regex-LE: Validate Patterns in Workspace from the command palette.Extract Patterns from Folder or Validate Patterns in Folder. The same two commands in the palette ask for a folder.A project writes the same pattern in many places, so the report is the distinct patterns and where each one is, the most widely used first:
# Regex-LE workspace report
my-project · 3 file(s) read · 3 distinct pattern(s) in 3 file(s)
| Pattern | Files |
|---|---|
/\d+/g | 2 |
/\d+/ | 1 |
/^x$/ | 1 |
/\d+/g (2)src/a.ts · 1:11src/b.ts · 1:11/\d+/ (1)src/c.py · 2:5/^x$/ (1)src/a.ts · 2:11
Two patterns are the same when their text and flags are, so /\d+/g and /\d+/ are listed apart. A pattern is counted once per file, at the first place it is written there.
The report opens with a table of the files that hold something to look at, then lists the patterns that can hang:
# Regex-LE workspace report
my-project · 3 file(s) read · 5 pattern(s), 1 can hang, 1 not checked
| File | Patterns | Can hang | Not checked |
|---|---|---|---|
src/a.ts | 2 | 1 | 0 |
src/b.py | 2 | 0 | 1 |
1 other file(s) hold only patterns with no finding.
src/a.ts (1)/(a+)+$/ · can hang (high): exponential backtracking: 2000000 steps on 41 characters, against 229328 on 20 · complexity 0/100
Can hang means an input was found that drives the pattern into backtracking, the same search ReDoS screening describes. Not checked means the search could not answer for the pattern either way, because it uses a backreference or a lookaround. That is not a verdict on the pattern, and the report gives the reason.
A pattern written for another language's engine is read, not refused: a Python (?P \d{4}), an atomic group or a possessive quantifier is searched like any
只显示了开头部分;其余内容请在仓库中阅读