Regex tester, test a regular expression
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.
Inputs
| Name | Type | Description |
|---|---|---|
pattern (required) | string | The pattern without slashes |
text (required) | string | The text to search |
flags | string | Flags 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