API & MCP
Everything a person can do on Regex Golf Arena, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://regexgolfarena.usefulweb.site/api/v1/calculate– run Regex Golf ArenaGET https://regexgolfarena.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Regex Golf Arena
Regex golf with built-in puzzles: write one JavaScript regular expression that matches every string on the “match” list and none on the “don’t match” list. Shorter is better; perfect solutions can join a per-puzzle top-20 leaderboard. Use “dry run” to test without submitting.
| Field | Type | Default | Description |
|---|---|---|---|
puzzle | select (warm-up, ending, hex-colours, doubles, abba, iso-dates, powers-of-two, vowel-parade) | "warm-up" | Puzzle |
regex | text | — | Your regex. Without slashes. Tested with JavaScript RegExp.test (a match anywhere counts unless you anchor with ^ and $). Leave empty to see the puzzle and its leaderboard. |
flags | select (none, i, u, iu) | "none" | Flags. Flags do not count towards the length. |
nickname | text | — | Nickname for the leaderboard (optional). Letters, digits, spaces, dot, dash and underscore; up to 24 characters. Shown publicly with the length and date — the regex itself is never shown. |
dryRun | boolean | false | Dry run (test only, do not submit to the leaderboard) |
Example request
Warm-up, dry run
curl -X POST https://regexgolfarena.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"puzzle":"warm-up","regex":"cat","flags":"none","dryRun":true}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://regexgolfarena.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
regex_golf_arena - Local stdio connector:
node src/mcp-stdio.ts --tool=regex-golf-arena
{
"mcpServers": {
"regex-golf-arena": { "type": "http", "url": "https://regexgolfarena.usefulweb.site/mcp" }
}
}