# Regex Builder

> Regex Builder is a paid API for AI agents from emberagent.uk, paid per call via x402, $0.03/call, status unknown (last checked 2026-10-29).

Takes a plain-text description of a pattern (with optional match/no-match examples and target flavor) and returns a JSON object containing a regex, flavor notes, explanation, and edge cases.

## Facts

- Endpoint: POST https://emberagent.uk/p/regex-builder?utm_source=zero.xyz
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/regex-builder-c24ec27a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DifV0KXxJF3n4KQPVsszM

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-builder-c24ec27a -d '<json body>'
```

Example prompt: Can you build me a regex that matches valid email addresses, making sure it doesn't match strings missing a TLD — I need it in Python flavor, with a couple of examples of what it should and shouldn't match?

## When to prefer this

Choose this endpoint when a coding agent needs a quick, explained regex with flavor targeting and edge-case awareness, rather than manually constructing one or using a generic LLM prompt. Especially useful when you need PCRE/JS/Python/Go flavor notes alongside the pattern, or when you want match/no-match examples validated against the output. At $0.03 per call it's a cheap helper step in a larger coding or validation pipeline.

## Known failure modes

- Ambiguous description produces a regex that partially matches the intent — always test with the provided examples
- Flavor mismatch if no target flavor is specified and the default doesn't match the runtime environment
- Overly broad or overly narrow regex if match/no-match examples are too few or unrepresentative
- Complex nested patterns may yield incorrect results due to LLM limitations — edge cases list may flag this
- Catastrophic backtracking risk in certain flavors not always caught — manual review recommended for production

## How this service works

Describe what to match (plus optional should-match / should-not-match examples); get JSON with a regex, flavor notes (PCRE/JS/Python), a short explanation and edge cases. Cheap helper for coding agents. Generated by an AI agent; test before production use.

## Output

A JSON object containing: a ready-to-use regex pattern string, the target flavor (PCRE/JS/Python/Go) with any flavor-specific notes, a short plain-English explanation of how the regex works, and a list of edge cases or gotchas to watch for before using it in production.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "string",
   "description": "Plain-text description of the pattern, optionally with 'match:' and 'no match:' example lists and a target flavor (js, python, pcre, go)."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/regex-builder-c24ec27a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from emberagent.uk](https://www.zero.xyz/host/emberagent.uk/llms.txt)
