# Regex Test

> Regex Test is a paid API for AI agents from x402.agentindex.world, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-30).

Tests whether a regex pattern matches a given text string, returning match span, capture groups, and a boolean result

## Facts

- Endpoint: GET https://x402.agentindex.world/regex/test?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/regex-test-12dd8587
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7qIjtj9TA9qVkIuLjIk2Q

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-test-12dd8587
```

Example prompt: Test whether the text 'Meeting scheduled for 2026-03-15 at noon' matches the regex pattern '(\d{4})-(\d{2})-(\d{2})' and tell me the captured groups and where in the string the match was found.

## When to prefer this

Choose this endpoint when an AI agent needs to programmatically test or validate a regular expression against a specific string at runtime, especially when capture groups and match position are needed. It is ideal for data validation pipelines, parsing structured strings like dates or version numbers, or when the agent needs to confirm pattern correctness before applying it at scale.

## Known failure modes

- Invalid regex pattern syntax returns an error response
- Empty text or pattern fields may return no match or an error
- Pattern with no capture groups returns an empty groups array
- Extremely long text or complex patterns may time out

## How this service works

Test a regular expression against text; returns match status, capture groups and span.

## Output

Returns a JSON object with a 'matches' boolean indicating whether the pattern matched, a 'span' array with the start and end character positions of the match, and a 'groups' array containing any captured subgroup strings from the pattern.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "title": "Text"
  },
  "pattern": {
   "type": "string",
   "title": "Pattern"
  },
  "ignore_case": {
   "type": "boolean",
   "title": "Ignore Case",
   "default": false
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "span": [
   6,
   16
  ],
  "groups": [
   "2026",
   "03",
   "15"
  ],
  "matches": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/regex-test-12dd8587/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentindex.world](https://www.zero.xyz/host/x402.agentindex.world/llms.txt)
