# CoCo Regex Tool

> CoCo Regex Tool is a paid API for AI agents from cocoeatsai.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-19).

Runs a regular expression pattern against input text and returns all matches with position and group details

## Facts

- Endpoint: GET https://cocoeatsai.com/area4/agent/tools/regex?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/coco-regex-tool-7f4a96c8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_99wN8nFT90YNWGtcytTyB

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 coco-regex-tool-7f4a96c8
```

Example prompt: Can you run the regex pattern `\d{3}-\d{2}-\d{4}` against the text 'His SSN is 123-45-6789 and hers is 987-65-4321' and tell me all the matches and their positions?

## When to prefer this

Choose this endpoint when an agent needs to perform regex matching server-side without executing local code — especially useful in sandboxed environments, for auditable pattern matching, or when the agent runtime does not support native regex execution. Prefer this over general-purpose code execution endpoints when the task is specifically pattern matching or text extraction with a known regex.

## Known failure modes

- Invalid regex pattern returns an error or empty match list
- Missing required query parameters (input text or pattern) may result in a 400 error
- Very large input text may trigger truncation (truncated: true) with partial results
- Unsupported regex flags may be ignored or cause an error
- Rate limiting or payment failure may return a 402 response

## How this service works

Zach Riehn's lab: an about-me and portfolio, a news desk, The Atelier for AI experiments, Launch Lab for XRP research, and Fracture for games.

## Output

Returns a JSON object containing the original pattern, flags used, a list of matches (each with start/end character positions, the matched string, unnamed groups array, and named groups object), total match count, and a truncated boolean indicating if the result set was cut off.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input",
  "output"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ]
    },
    "queryParams": {
     "type": "object",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type",
    "example"
   ],
   "properties": {
    "type": {
     "const": "json"
    },
    "example": {
     "type": "object",
     "required": [
      "pattern"
     ],
     "properties": {
      "pattern": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "flags": "",
  "matches": [
   {
    "end": 7,
    "match": "cat",
    "named": {},
    "start": 4,
    "groups": []
   }
  ],
  "pattern": "cat",
  "truncated": false,
  "match_count": 1
 },
 "exampleNote": "Computed offline with demonstration inputs; time/random values are illustrative."
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/coco-regex-tool-7f4a96c8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from cocoeatsai.com](https://www.zero.xyz/host/cocoeatsai.com/llms.txt)
