Regex tester, test a regular expression

$0.01 per call · failed calls are never charged · no account or API key needed

Run a JavaScript regular expression against a text and return every match with its index and capture groups (named groups included). Pattern up to 300 characters, text up to 5,000; patterns with nested quantifiers such as (a+)+ are refused as unsafe, uncharged. Use to check a pattern before using it in code.

Run it free (25 free calls) Buy credits by card (from $5) Example result (JSON)

Try it with your own inputs

The pattern without slashes
The text to search

Uses one of your 25 free calls. Nothing is charged, and a call that fails is not counted.

Inputs

NameTypeDescription
pattern (required)stringThe pattern without slashes
text (required)stringThe text to search
flagsstringFlags such as g, i, m, s, u (g is always added)

Request

Over HTTP, with a card key from /credits:

curl -H "Authorization: Bearer adt_…" "https://agent-data-tools.revmesh2074.workers.dev/regex/test?pattern=(%5Cd%7B4%7D)-(%5Cd%7B2%7D)&text=2026-10%20and%202027-01"

Or one of your 25 free calls, no key:

curl "https://agent-data-tools.revmesh2074.workers.dev/regex/test?pattern=(%5Cd%7B4%7D)-(%5Cd%7B2%7D)&text=2026-10%20and%202027-01&trial=1"

Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum or Solana over x402; Base or Tempo over MPP) and retries.

Example result

{
  "valid": true,
  "count": 2,
  "matches": [
    {
      "match": "2026-10",
      "index": 0,
      "groups": [
        "2026",
        "10"
      ],
      "named": null
    }
  ]
}

From an AI agent (MCP)

Add the MCP server to Claude, Cursor or any MCP client. This tool is regex_test, and the first 25 successful calls are free:

https://agent-data-tools.revmesh2074.workers.dev/mcp

Related tools