# 24K Labs Regex Tester

> 24K Labs Regex Tester is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-13).

Tests a regular expression against input text and returns all matches, capture groups, named groups, and character span positions.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/v1/regex-test
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/24k-labs-regex-tester-aec1caab
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__Q3gg_-PArNiE3bT_ymK_

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 24k-labs-regex-tester-aec1caab -d '<json body>'
```

Example prompt: Test the regex pattern `(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})` against this text: 'Order placed on 2024-03-15 and shipped on 2024-04-01' — I want all matches, named groups, and the character spans for each match.

## When to prefer this

Choose this endpoint when you need to programmatically test or debug a regex pattern against text and require structured output including capture groups, named groups, and span positions — especially useful in agentic workflows where downstream steps need to consume match data. Prefer it over running regex locally when you need a deterministic remote result with span metadata or when building no-code/low-code automation that lacks a native regex engine.

## Known failure modes

- Invalid regex syntax returns an error describing the pattern fault
- Empty input text returns zero matches
- Catastrophic backtracking on complex patterns may time out
- Flags not supported by the engine return an error
- Pattern with no matches returns an empty matches array

## How this service works

Test a regex against text; returns matches, capture and named groups, and spans.

## Output

Returns a structured response containing an array of matches, each with the full matched string, an array of positional capture groups, a map of named capture groups (if any), and the start/end character span within the input text. Also includes a total match count.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string"
  },
  "flags": {
   "type": "string"
  },
  "pattern": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "match_count": 2
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/24k-labs-regex-tester-aec1caab/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
