# BitBooth Regex Test

> BitBooth Regex Test is a paid API for AI agents from app.heinrichstech.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-11).

Safely compiles and runs a JavaScript regex against a text corpus, returning structured matches with capture groups, indices, and lengths, with ReDoS protection via a hard CPU deadline.

## Facts

- Endpoint: POST https://app.heinrichstech.com/v1/cdp/regex-test?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bitbooth-regex-test-3ea5f62d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_C7ibq5K2IDqb08JOqXhLL

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 bitbooth-regex-test-3ea5f62d -d '<json body>'
```

Example prompt: Can you run the regex /^(\d{4})-(\d{2})-(\d{2})$/ with the 'g' and 'm' flags against this text and give me all the matches with their capture groups and positions: '2024-01-15\nfoo\n2023-12-31'?

## When to prefer this

Choose this endpoint when you need to safely execute JavaScript regex patterns — especially untrusted or user-supplied patterns — against a text corpus without risking server-side ReDoS hangs. Ideal for agents that need structured match data (capture groups, indices, lengths) rather than a simple boolean match. The hard CPU deadline makes it safe for production use with arbitrary patterns. Prefer it over client-side execution when you need a stateless, auditable, pay-per-use match service with no API key management.

## Known failure modes

- Catastrophic backtracking / ReDoS: returns regex_timeout flag instead of hanging
- Invalid regex syntax: returns a compile error
- Invalid JS flags: returns a validation error
- Payment not included or insufficient: returns 402 Payment Required
- Malformed request body: returns 400 Bad Request

## How this service works

BitBooth Regex Test: pay 0.001 USDC, safely compile and run a regex against a corpus. Returns structured matches with capture groups, indices, and lengths. JS engine flags (g, i, m, s, u, y, d). Hard CPU deadline guards against catastrophic backtracking (ReDoS) — `regex_timeout` is reported instead of stalling. Stateless, no API key.

## Output

A structured JSON response containing an array of matches, each with the full match string, an array of capture group values, the zero-based start index in the corpus, and the match length. If the regex execution exceeds the CPU deadline due to catastrophic backtracking, a `regex_timeout` flag is set instead of stalling indefinitely.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "pattern",
      "input"
     ],
     "properties": {
      "flags": {
       "type": "string",
       "maxLength": 8
      },
      "input": {
       "type": "string"
      },
      "pattern": {
       "type": "string",
       "maxLength": 1024
      },
      "captureLimit": {
       "type": "integer",
       "maximum": 1000,
       "minimum": 1
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bitbooth-regex-test-3ea5f62d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from app.heinrichstech.com](https://www.zero.xyz/host/app.heinrichstech.com/llms.txt)
