# 2s Regex Test

> 2s Regex Test is a paid API for AI agents from 2s.io, paid per call via x402, $0.0025/call, status unknown (last checked 2026-12-03).

Tests whether a regular expression pattern matches against an input string, with optional regex flags

## Facts

- Endpoint: POST https://2s.io/api/dev/regex-test?utm_source=zero.xyz
- Price: $0.0025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-regex-test-311dc26a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Z8ohgv4qo2wgnVvSz1dWg

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 2s-regex-test-311dc26a -d '<json body>'
```

Example prompt: Test whether the regex pattern ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ matches the string 'user@example.com', using case-insensitive flag 'i'.

## When to prefer this

Use this endpoint when you need a quick, pay-per-call regex test without setting up a runtime environment — ideal for agents validating user input formats, debugging regex patterns on the fly, or extracting capture groups from strings without executing code locally.

## Known failure modes

- Invalid regex pattern syntax returns an error
- Pattern or input exceeding character limits rejected
- Unsupported flag characters cause validation error
- Empty pattern rejected due to minLength constraint

## How this service works

The (most) everything API: 575+ pay-per-call endpoints for AI agents — ground-truth data, a full AI gateway, and agent infrastructure (storage, queues, watchers). USDC via x402, no signup, no API keys, and upto billing: pay actual usage, not the quote.

## Output

Returns whether the pattern matched the input string, along with any captured groups, the index of the match, and the full matched substring if a match was found.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "flags": {
   "type": "string",
   "maxLength": 8
  },
  "input": {
   "type": "string",
   "maxLength": 50000
  },
  "pattern": {
   "type": "string",
   "maxLength": 1000,
   "minLength": 1
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-regex-test-311dc26a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
