# MolCloud Regex Validator

> MolCloud Regex Validator is a paid API for AI agents from api.molcloud.net, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-17).

Tests a text corpus against a regular expression pattern and returns match validity and match count

## Facts

- Endpoint: POST https://api.molcloud.net/api/tools/regex?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/molcloud-regex-validator-b768a702
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TzCwtaJ5CSteMMFbRXsQx

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 molcloud-regex-validator-b768a702 -d '<json body>'
```

Example prompt: Test whether the pattern \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b with flags 'gi' matches anything in this text: 'Contact us at support@example.com or sales@company.org for help.'

## When to prefer this

Choose this endpoint when an AI agent needs lightweight, pay-per-use regex validation or match counting without spinning up a code execution environment. Ideal for pipelines that need to validate user input formats, scan text for patterns, or count occurrences at low cost ($0.002 USDC) without managing infrastructure.

## Known failure modes

- Invalid regex pattern syntax returns an error or isValid:false with matchCount 0
- Missing required 'pattern' or 'text' fields causes a 400-level error
- Extremely large text corpora may hit request size limits
- Unsupported flag characters may be silently ignored or cause errors
- Payment failure via x402 returns a 402 response before processing

## How this service works

41 pay-per-request AI, search, headless browser, crypto alpha & memory APIs for autonomous agents settling in USDC on Base via x402 v2.

## Output

Returns a JSON object with a 'data' field containing 'isValid' (boolean indicating whether the pattern matched at all) and 'matchCount' (integer of total matches found), plus a 'status' string and the endpoint path confirming the call.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "Text corpus to test against"
  },
  "flags": {
   "type": "string",
   "default": "g",
   "description": "Regex flags (default: g)"
  },
  "pattern": {
   "type": "string",
   "description": "Regular expression pattern"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "isValid": true,
   "matchCount": 1
  },
  "status": "success",
  "endpoint": "/api/tools/regex"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/molcloud-regex-validator-b768a702/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.molcloud.net](https://www.zero.xyz/host/api.molcloud.net/llms.txt)
