# RE2 Regex Test (openverbs)

> RE2 Regex Test (openverbs) is a paid API for AI agents from regex.openverbs.com, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-14).

Tests whether a RE2 regular-expression pattern matches anywhere in an input string, returning a boolean matched result with linear-time safety guarantees.

## Facts

- Endpoint: POST https://regex.openverbs.com/v1/test
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/re2-regex-test-openverbs-85e575a0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2J6aJ6VgDw5-7ry2GgvFl

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 re2-regex-test-openverbs-85e575a0 -d '<json body>'
```

Example prompt: Check if this text contains a valid ISO 8601 date somewhere — use the RE2 pattern `\d{4}-\d{2}-\d{2}` and test it against: 'The event is scheduled for 2024-07-15 at the main venue.'

## When to prefer this

Choose this endpoint when you need a safe, guaranteed linear-time regex match test — especially when the pattern or input is untrusted or large, making catastrophic backtracking (ReDoS) a concern. Prefer it over PCRE-based alternatives when you only need a yes/no match result and want RE2 semantics. It is ideal for validation steps in automated pipelines where a simple boolean answer is sufficient.

## Known failure modes

- Invalid RE2 pattern syntax returns HTTP 400 with a descriptive error message
- Input text exceeding 1,000,000 characters will be rejected
- Pattern exceeding 4,096 characters will be rejected
- Unsupported regex flags (only i, m, s are valid) may cause a 400
- Payment required (402) if x402 micropayment header is missing or invalid

## How this service works

Test whether a RE2 pattern matches anywhere in the input. Returns { matched }. RE2 guarantees linear-time evaluation, so this is safe against catastrophic backtracking. An invalid pattern is a clean 400; no match is a successful 200.

## Output

A JSON object with a single boolean field `matched` — true if the RE2 pattern was found anywhere in the subject text, false if no match was found. An invalid RE2 pattern returns a 400 error with a description of the parse failure.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "pattern",
      "input"
     ],
     "properties": {
      "flags": {
       "type": "string",
       "maxLength": 8,
       "description": "Any of i (case-insensitive), m (multiline ^$), s (dotall). Default none."
      },
      "input": {
       "type": "string",
       "maxLength": 1000000,
       "description": "The subject text."
      },
      "pattern": {
       "type": "string",
       "maxLength": 4096,
       "minLength": 1,
       "description": "RE2 regular-expression pattern."
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/re2-regex-test-openverbs-85e575a0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from regex.openverbs.com](https://www.zero.xyz/host/regex.openverbs.com/llms.txt)
