# Agent402 UK Regex Tester

> Agent402 UK Regex Tester is a paid API for AI agents from agent402.co.uk, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Tests a JavaScript regex pattern against a text string and returns whether it matched, the match value, and pattern validity

## Facts

- Endpoint: POST https://agent402.co.uk/v1/utils/regex
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-uk-regex-tester-36dbab6d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BQmHEP6KNsA5qDh0QU17c

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 agent402-uk-regex-tester-36dbab6d -d '<json body>'
```

Example prompt: Can you test the regex pattern ^GB[0-9]{9}$ against the text 'GB123456789' and tell me if it matches?

## When to prefer this

Choose this endpoint when an AI agent needs a deterministic, safe regex evaluation without risk of hallucinating match results. It is especially useful when the agent must not invent whether a pattern matches — such as input validation gates, data extraction checks, or pre-flight format verification — and when the pattern is a JS-compatible regex.

## Known failure modes

- Invalid regex syntax returns valid:false and no match result
- Empty pattern or text may return matched:false with no error detail
- Unsupported flags (outside gimsuy) may cause the pattern to be rejected
- Network or payment failure returns HTTP 402 or 5xx with no result

## How this service works

Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.

## Output

Returns a JSON object with three fields: 'valid' (boolean indicating whether the regex pattern itself is syntactically valid), 'matched' (boolean indicating whether the pattern matched the input text), and 'match' (the matched substring if a match was found).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "Input text"
  },
  "flags": {
   "type": "string",
   "description": "Optional flags gimsuy"
  },
  "pattern": {
   "type": "string",
   "description": "JS regex source"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "match": "GB123",
  "valid": true,
  "matched": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-uk-regex-tester-36dbab6d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.co.uk](https://www.zero.xyz/host/agent402.co.uk/llms.txt)
