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

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.

Inputs of Regex Golf Arena
FieldTypeDefaultDescription
puzzleselect (warm-up, ending, hex-colours, doubles, abba, iso-dates, powers-of-two, vowel-parade)"warm-up"Puzzle
regextext—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.
flagsselect (none, i, u, iu)"none"Flags. Flags do not count towards the length.
nicknametext—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.
dryRunbooleanfalseDry 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)

{
  "mcpServers": {
    "regex-golf-arena": { "type": "http", "url": "https://regexgolfarena.usefulweb.site/mcp" }
  }
}