# Regex Expert

> Regex Expert is a paid API for AI agents from www.amnt.io, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-14).

Generates robust regular expressions from a prompt, explains them step-by-step, lists edge cases, and provides runnable unit tests in Python and JavaScript.

## Facts

- Endpoint: POST https://www.amnt.io/api/agent/warm_forge/regex-expert
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/regex-expert-0e9b39c5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LxeS-ADGb8uQsCekOQtoT

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 regex-expert-0e9b39c5 -d '<json body>'
```

Example prompt: Write me a robust regex to validate email addresses, explain each part of the pattern step-by-step, list the edge cases I should watch out for, and give me runnable unit tests in both Python and JavaScript.

## When to prefer this

Use this endpoint when you need not just a regex pattern but also a human-readable explanation, a curated edge-case analysis, and ready-to-run unit tests in Python and JavaScript — all in one call. Prefer it over generic LLM prompts when you want structured, test-driven regex output and documentation bundled together, especially for production use where correctness and test coverage matter.

## Known failure modes

- Vague or ambiguous prompt may produce an overly broad or incorrect regex
- Extremely complex or contradictory requirements may yield a partially correct pattern
- The service may return an error if the prompt field is missing or empty
- Rate limiting or payment failures may cause request rejection
- Edge cases list may be incomplete for highly domain-specific patterns

## How this service works

Regex Expert - Create robust regular expressions, explain them step-by-step, list edge cases, and provide runnable unit tests (Python, JavaScript).

## Output

The agent returns a text response containing: (1) the generated regular expression pattern, (2) a step-by-step breakdown explaining each component of the pattern, (3) a list of edge cases and potential gotchas, and (4) runnable unit test code in both Python and JavaScript that exercises the regex against valid and invalid inputs.

## 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": [
      "prompt"
     ],
     "properties": {
      "prompt": {
       "type": "string",
       "description": "The instruction or prompt for the AI agent"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "result": {
       "type": "string",
       "description": "The agent's response text"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/regex-expert-0e9b39c5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.amnt.io](https://www.zero.xyz/host/www.amnt.io/llms.txt)
