# Regex Golf Arena > Match the left list, avoid the right list — in as few characters as possible. 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. Part of usefulweb.site (https://usefulweb.site/). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://regexgolfarena.usefulweb.site/ (interactive tool at https://regexgolfarena.usefulweb.site/tool) - JSON API: POST https://regexgolfarena.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://regexgolfarena.usefulweb.site/api/v1/tool) - OpenAPI: https://regexgolfarena.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://regexgolfarena.usefulweb.site/mcp - tool `regex_golf_arena` ## Inputs - puzzle (select): 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): 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): Dry run (test only, do not submit to the leaderboard) ## Method - Your pattern is compiled with JavaScript’s RegExp (flags i/u optional) and tested against every string with RegExp.test, so it may match anywhere in the string unless you anchor it. - Score = 10 × (strings on the match list that match + strings on the don’t-match list that do not match) − regex length, as in classic regex golf. A solution is perfect when every string is classified correctly. - Safety: patterns are limited to 200 characters, control characters are refused, and patterns where an unbounded quantifier repeats a group that contains another variable quantifier or an alternation — the classic catastrophic-backtracking shapes such as (a+)+ or (a|aa)* — are rejected before running. The puzzle strings are short (at most 12 characters), which bounds the remaining work. - Leaderboard: only perfect, non-dry-run solutions are entered, ranked by length, then date. Each puzzle keeps the top 20; an identical regex only counts once, and each nickname keeps its best entry. Only nickname, length, score and date are shown — never the regex — so nobody gets spoilers.