# Strale Regex Generator

> Strale Regex Generator is a paid API for AI agents from api.strale.io, paid per call via x402, $0.054001/call, status unknown (last checked 2026-10-12).

Converts a natural language description into a tested, production-ready regular expression, with optional validation against provided test strings

## Facts

- Endpoint: GET https://api.strale.io/x402/regex-generate?utm_source=zero.xyz
- Price: $0.054001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-c602f0ef
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_o8i3IvFadkmptvEuCHo7x

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 api-strale-io-c602f0ef
```

Example prompt: Give me a tested regex that matches US phone numbers in the formats (555) 123-4567, 555-123-4567, and +1-555-123-4567, and validate it against these strings: '(212) 555-1234', '555-867-5309', 'not-a-phone'.

## When to prefer this

Choose this endpoint when you need to quickly generate a regex from a plain English description without writing it manually, especially when you can provide test strings to verify correctness. Ideal for developers, data pipelines, or AI agents that need dynamic pattern matching without embedding regex expertise.

## Known failure modes

- Ambiguous description may produce a regex that partially matches intent — provide test strings to reduce ambiguity
- Very complex patterns may have edge cases not covered — caller should supply representative test strings
- If no valid regex can be constructed from the description, an error or empty result is returned

## How this service works

Describe what you want to match in natural language, get a tested regex back. Optionally provide test strings for validation.

## Output

A production-ready regular expression pattern matching the described criteria, along with validation results showing whether the regex correctly matches or rejects each provided test string

## Example request

```json
{
 "description": "Match email addresses in standard format (name@domain.extension)",
 "test_strings": [
  "user@example.com",
  "john.doe@company.co.uk",
  "invalid.email@",
  "notanemail"
 ]
}
```

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "description"
     ],
     "properties": {
      "description": {
       "type": "string",
       "description": "What to match in natural language"
      },
      "test_strings": {
       "type": "array",
       "description": "Optional strings to test against"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-c602f0ef/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
