# Wealth Agent Regex Search

> Wealth Agent Regex Search is a paid API for AI agents from wealth-agent.wealthagent-app.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-19).

Runs a regular expression pattern against provided text and returns all matches with their positions and capture groups

## Facts

- Endpoint: GET https://wealth-agent.wealthagent-app.workers.dev/api/x402/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/wealth-agent-regex-search-43aba9d5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BStrEs5FjBjxNvPBb3qHZ

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 wealth-agent-regex-search-43aba9d5
```

Example prompt: Search this log output for any lines containing 'ERROR' followed by a word, using the pattern 'ERROR (\w+)' with the global flag — the text is: 'ERROR timeout\nINFO ok\nERROR crashed'

## When to prefer this

Choose this endpoint when you need server-side regex execution without running code locally, when the agent environment lacks a code interpreter, or when you want a pay-per-call regex service with structured match output including group captures and character indices. Prefer over client-side execution when you need auditable, reproducible text extraction with receipt tracking.

## Known failure modes

- Invalid regex pattern returns an error response
- Text exceeding 20,000 characters is rejected
- Pattern exceeding 200 characters is rejected
- Invalid flag characters cause a parse error
- Payment not confirmed results in paid_not_delivered status
- No matches found returns an empty matches array with count 0

## How this service works

Apply one regular expression to a text blob on the server and return every match with its index and capture groups. Deterministic, so the same input always returns the same answer. Useful for log triage, field extraction and validation at scale.

## Output

Returns a JSON object with the total match count, and an array of match objects each containing the matched string, its character index in the original text, and any captured groups from parentheses in the pattern.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "pattern",
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "description": "Text to search (max 20,000 chars)"
      },
      "flags": {
       "type": "string",
       "description": "g, i, m, s, u, y (optional)"
      },
      "pattern": {
       "type": "string",
       "description": "Regular expression (max 200 chars)"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "ok",
      "resource",
      "status",
      "deliverable"
     ],
     "properties": {
      "ok": {
       "type": "boolean"
      },
      "tx": {
       "type": [
        "string",
        "null"
       ]
      },
      "note": {
       "type": "string"
      },
      "error": {
       "type": [
        "string",
        "null"
       ]
      },
      "job_id": {
       "type": [
        "string",
        "null"
       ]
      },
      "status": {
       "enum": [
        "delivered",
        "paid_not_delivered"
       ],
       "type": "string"
      },
      "resource": {
       "type": "string"
      },
      "receipt_id": {
       "type": [
        "string",
        "null"
       ]
      },
      "deliverable": {
       "type": [
        "object",
        "null"
       ],
       "required": [
        "kind",
        "summary"
       ],
       "properties": {}
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "kind": "regex",
  "count": 2,
  "matches": [
   {
    "index": 0,
    "match": "ERROR timeout",
    "groups": [
     "timeout"
    ]
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/wealth-agent-regex-search-43aba9d5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from wealth-agent.wealthagent-app.workers.dev](https://www.zero.xyz/host/wealth-agent.wealthagent-app.workers.dev/llms.txt)
