# Toolbelt402 Regex Tester

> Toolbelt402 Regex Tester is a paid API for AI agents from toolbelt402.tpoborne.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Tests and debugs a regular expression against up to 50 sample strings, returning match results, capture groups, named groups, and pass/fail evaluations against expectations.

## Facts

- Endpoint: POST https://toolbelt402.tpoborne.workers.dev/regex/test
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/toolbelt402-regex-tester-552c5040
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_nCOMgDxIWp0aXAVIPho8Y

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability toolbelt402-regex-tester-552c5040 -d '<json body>'
```

Example prompt: Can you test my regex pattern `^(\d{4})-(\d{2})-(\d{2})$` with the `i` flag against these strings: '2024-01-15' (expect match), 'hello-world' (expect no match), and '2024-13-99' (expect no match) — and show me the capture groups?

## When to prefer this

Choose this endpoint when you need deterministic, server-side regex validation with structured pass/fail reporting across multiple test strings — especially when you want capture group and named group extraction confirmed, or when building/debugging regex patterns programmatically without relying on a local execution environment.

## Known failure modes

- Invalid regex pattern syntax returns an error describing the parse failure
- Exceeding 50 test cases may result in truncation or rejection
- Unsupported or conflicting regex flags return a flag validation error
- Missing required fields (pattern or cases) result in a 400-level error
- Regex with catastrophic backtracking may time out

## How this service works

Test and debug a regular expression against up to 50 sample strings — real match results, capture groups, named groups, and pass/fail against expectations. Deterministic regex testing.

## Output

Returns per-test-case results including whether the regex matched each input string, the full match text, indexed capture groups, named capture groups, match positions, and a pass/fail verdict compared against the expected outcome. Typically covers up to 50 test cases per call.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "cases": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "input": {
      "type": "string"
     },
     "expectMatch": {
      "type": "boolean"
     }
    }
   }
  },
  "flags": {
   "type": "string",
   "description": "Any of g i m s u y v d"
  },
  "pattern": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/toolbelt402-regex-tester-552c5040/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from toolbelt402.tpoborne.workers.dev](https://www.zero.xyz/host/toolbelt402.tpoborne.workers.dev/llms.txt)
