# Arch Tools — Regex Generate

> Arch Tools — Regex Generate is a paid API for AI agents from archtools.dev, paid per call via x402, $0.015/call, status unknown (last checked 2026-09-14).

Generates a regular expression pattern from a plain English description, optionally validating it against test strings

## Facts

- Endpoint: POST https://archtools.dev/v1/tools/regex-generate
- Price: $0.015/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/arch-tools-regex-generate-ca72db40
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lr7UxK-5Txx9BTnXWZTTA

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 arch-tools-regex-generate-ca72db40 -d '<json body>'
```

Example prompt: Generate a regex pattern that matches valid US phone numbers in formats like (555) 123-4567 or 555-123-4567, and test it against these strings: '(800) 555-1234', '123-456-7890', 'not-a-phone'.

## When to prefer this

Choose this endpoint when you need to programmatically generate a correct regex from a natural language spec, especially when you want immediate validation against sample strings. Ideal for developers or agents that need to automate pattern-matching logic without manually crafting and debugging regex syntax.

## Known failure modes

- Ambiguous description leads to an incorrect or overly broad pattern
- Description references edge cases the model cannot infer without examples
- Test strings reveal the generated pattern is incomplete — may require refining the description
- Description is too complex for a single regex — multi-step logic may be needed
- API returns an error if required 'description' field is missing

## How this service works

Generate regex from plain English with explanations. Pay per call with USDC (x402) or credits - archtools.dev

## Output

A JSON object containing the generated regex pattern, an explanation of how it works, and optionally the results of testing it against any provided test strings indicating which strings matched and which did not.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "description": {
   "type": "string",
   "description": "Plain English description of the pattern to match"
  },
  "test_strings": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "Optional strings to test the generated regex against"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/arch-tools-regex-generate-ca72db40/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from archtools.dev](https://www.zero.xyz/host/archtools.dev/llms.txt)
