Regex Check
Runs regex patterns on the real JavaScript engine (V8) and reports its own verdict: compile errors with position, every match with its groups and named groups, and the result of a replacement in JavaScript syntax. Also times the engine on a ReDoS attack string to show whether catastrophic backtracking actually happens.
Checks regex patterns against PCRE2, the engine nginx uses for its location and rewrite rules, so patterns can be validated for compile errors, match groups, and ReDoS vulnerability before they are deployed.
Runs regex patterns on PCRE2 10.48 in UTF mode, the engine behind PHP's preg_* functions, reporting its compile errors, matches with groups and named groups, replacement results, and its actual timing on a catastrophic-backtracking attack string.
Runs regex patterns on CPython's re engine (via Pyodide), reporting Python's own compile errors with position, every match with groups and named groups (including Python-only syntax like named groups), replacement results, and how long the engine takes on a ReDoS attack string.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Regex Check test ^(?P<year>\d{4})-(\d{2})$ on '2026-09' across all engines"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Regex Check
A regular expression means different things to different engines, and agents write them as if
it did not: (?P<name>...) is Python and refused by JavaScript, lookbehind is refused by Go and RE2,
\d matches Arabic-Indic digits in Python and not in JavaScript, ^abc$ matches "abc\n" in
Python and PHP and not in JavaScript, and ^(a+)+$ hangs a server on one crafted input. Regex
Check runs the pattern on the real engines, in process:
JavaScript (V8), Python (CPython's
re, through Pyodide), PCRE2 10.48 (PHP'spreg_*,grep -P, nginx) and RE2 (the syntax Go'sregexpand BigQuery accept).Each engine's own verdict: its compile error with the position, or every match with its groups and named groups, and the result of a replacement written in that engine's syntax. Positions are counted in characters for all four, and the report lists where the engines disagree.
ReDoS: whether a pattern can be made to backtrack catastrophically, exponential or polynomial, the part to blame marked in the pattern, an attack string, and how long each engine actually took on it.
Offline, no key.
Built and maintained by Arhan Canli.
Install
Needs Node.js 20 or newer. No account or key.
Claude Code
claude mcp add regex-check -- npx -y regex-check-mcpClaude Desktop: download regex-check-mcp-<version>.mcpb from the latest release and open it. The bundle is signed; verify it with gh attestation verify <file> --repo arhancanli/regex-check-mcp.
Any other client (Windsurf, Zed, Cline, Continue and others), in its MCP config file:
{
"mcpServers": {
"regex-check": {
"command": "npx",
"args": [
"-y",
"regex-check-mcp"
]
}
}
}Docker
docker build -t regex-check-mcp https://github.com/arhancanli/regex-check-mcp.git && docker run -i --rm regex-check-mcpHosted (Streamable HTTP): node src/server.mjs --http serves stateless MCP at POST /mcp (port from PORT, default 3000).
Related MCP server: regex-generator
Example
An agent calls test_regex with:
{
"pattern": "(?P<year>\\d{4})-(\\d{2})",
"inputs": [
"on 2026-09",
"٢٠٢٦-٠٩ and 1999-12"
],
"replacement": "\\2/\\1"
}and gets back (recorded from the live server on 2026-09-27):
{
"engines": [
{
"flavor": "javascript",
"engine": "V8 13.6.233.17-node.51 (Node v24.19.0)",
"error": {
"message": "Invalid group"
}
},
{
"flavor": "python",
"engine": "CPython 3.14.2 re (Pyodide)",
"results": [
{
"matches": [
{
"index": 3,
"text": "2026-09",
"groups": [
"2026",
"09"
],
"named": {
"year": "2026"
}
}
],
"match_count": 1,
"replaced": "on 09/2026"
},
{
"matches": [
{
"index": 0,
"text": "٢٠٢٦-٠٩",
"groups": [
"٢٠٢٦",
"٠٩"
],
"named": {
"year": "٢٠٢٦"
}
},
{
"index": 12,
"text": "1999-12",
"groups": [
"1999",
"12"
],
"named": {
"year": "1999"
}
}
],
"match_count": 2,
"replaced": "٠٩/٢٠٢٦ and 12/1999"
}
]
},
... (89 more lines)Tools
Tool | What it does |
| Checks a regex for catastrophic backtracking (ReDoS): safe or vulnerable, exponential or polynomial, the part of the pattern to blame, an attack string, and how long each real engine (JavaScript, Python, PCRE2, RE2) takes on it. Use before a pattern runs on untrusted input. |
| Runs a regex on real engines: JavaScript (V8), Python (CPython re), PCRE2 (PHP, grep -P), RE2 (Go, BigQuery). Each gives its compile error with position, or every match with groups and named groups, and the replacement result in its own syntax. Positions are in characters. Lists where engines disagree. |
How it behaves
Nothing leaves your machine and there is no network access (
factory.allowHostsis empty): the engines are compiled to WebAssembly (Python, PCRE2, RE2) or are Node's own (JavaScript).Each engine runs in its own worker thread with a time limit (5 s per call,
REGEX_CHECK_TIMEOUT_MSto change it): a pattern that backtracks forever on an input stops that engine only, which is replaced, and the others still answer. The engines start in the background when the server starts, so the first call does not wait for Python to load.PCRE2 runs in UTF mode, as PHP's
/umodifier uses it, with its default match limit. RE2 takes JavaScript-style$1replacements, as Go'sReplaceAllStringdoes. Up to 10,000 matches are counted per input andmax_matches(default 20) are listed.The ReDoS analysis is recheck (MIT), which proves a problem by building an attack string; the attack is then timed on each engine for 2 seconds.
Results are compact JSON with a matching output schema.
Benchmark
Not yet measured.
Performance
Measured 2026-09-27 from Dubai, home connection against the live upstream, Node 24.19.0 (bench/perf.json, scripts/perf.mjs in the factory).
Call | First call | Repeat | Result size |
test_regex: Python-style named groups and \d across four engines | 983 ms | 3.8 ms | 1,576 chars |
test_regex: a lookbehind, which RE2 refuses | 859 ms | 0.6 ms | 750 chars |
check_redos: nested repetition, measured on the engines | 2991 ms | 0.3 ms | 915 chars |
check_redos: an email pattern that is safe | 68 ms | 0.3 ms | 128 chars |
First call: a fresh server process, including the TLS connection and the upstream's own time. Repeat: the same call again, answered from the in-process cache, so it shows this server's own overhead.
Tool definitions the model reads on every turn (name, description, input schema): 1,490 characters, against 1,251 for @jkumonpm/regex-tester-mcp, a published regex MCP server (JavaScript engine only). The full tool list, with the output schemas and annotations clients use to validate results, is 2,124 characters (1,439 for the alternative).
More MCP servers by Arhan Canli
Actions Check: Checks GitHub Actions workflows: outdated actions, old Node runtimes, retired runners, injection.
Config Check: Validates config files against their official schemas: tsconfig, compose, workflows, 1,400+ more.
Cron Check: Explains cron expressions, lists next run times in any time zone, converts between cron dialects.
Dockerfile Check: Checks Dockerfiles: build-breaking mistakes, base image tags that exist, digests, platforms, EOL.
Domain Health: Email and domain checks: SPF lookup limits, DKIM keys, DMARC, DNS records, registration expiry.
End of Life: Is this version still supported? EOL dates, latest patch and upgrade target for 470+ products.
Internet Standards: RFC sections, status, obsoleted-by chains, errata and IANA registries for coding agents.
Kube Check: Checks Kubernetes manifests for your version: removed APIs, unknown fields, Pod Security, risks.
The whole collection, 12 more
License
MIT, Copyright (c) 2026 Arhan Canli.
Available Tools
2 toolscheck_redosCan this regex be made to hang?ARead-onlyIdempotent
Checks a regex for catastrophic backtracking (ReDoS): safe or vulnerable, exponential or polynomial, the part of the pattern to blame, an attack string, and how long each real engine (JavaScript, Python, PCRE2, RE2) takes on it. Use before a pattern runs on untrusted input.
Inputs: pattern (required), flags, verify. Returns: status
test_regexTest a regex on real enginesARead-onlyIdempotent
Runs a regex on real engines: JavaScript (V8), Python (CPython re), PCRE2 (PHP, grep -P), RE2 (Go, BigQuery). Each gives its compile error with position, or every match with groups and named groups, and the replacement result in its own syntax. Positions are in characters. Lists where engines disagree.
Inputs: inputs (required), pattern (required), flags, flavors, +2 more. Returns: engines
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: check_redos analyzes a pattern for catastrophic backtracking safety, while test_regex executes a pattern to report matches, groups, and engine differences. An agent can easily tell which to call based on whether the goal is safety analysis or behavior testing.
Both names follow the same snake_case verb_noun convention (check_redos, test_regex), with 'redos' and 'regex' as the clear noun targets. The pattern is fully predictable and consistent.
Two tools is on the thin side, but each is a substantial, well-defined operation covering a genuinely narrow domain (regex safety and engine behavior analysis). The scope justifies the small surface, though a third operation could round it out.
The surface covers the two core needs—vulnerability detection and cross-engine matching/testing—giving decent lifecycle coverage for the domain. Minor gaps exist (e.g., no pattern explanation or syntax conversion), but agents can work around them.
Maintenance
Related MCP Connectors
Explain a regex in plain English and detect catastrophic backtracking risk.
Detects catastrophic-backtracking (ReDoS) regex risk via AST parsing, with JS-safe rewrites.
Parallel regex across all Boolsai scans — discover new vendor patterns, niche signals. 4 tools.
Deterministic regex synthesis from labeled examples. Zero LLM, proof matrix, backtracking audit.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides tools to test regex patterns for correctness, performance (ReDoS), and memory usage, and suggests safe rewrites. Enables LLMs to iterate on regex generation with verifiable feedback.9MIT
- AlicenseNot gradedqualityCmaintenanceEnables testing regular expressions against strings to retrieve matches, capture groups, positions, and human-readable pattern explanations via an x402 micropayment MCP server.1MIT
- AlicenseAqualityCmaintenanceEnables AI agents to explain regex patterns in plain English and statically assess ReDoS risk before shipping, without executing the pattern or requiring an API key.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables users to statically analyze regular expressions for catastrophic-backtracking (ReDoS) risk through real AST parsing rather than executing the pattern, flagging nested quantifiers, ambiguous alternation, and backreferences. It also generates candidate proof-of-concept attack strings with a timeout-guarded test snippet and suggests JavaScript-safe rewrites.MIT