# Regex Match (RE2) – regex.openverbs.com

> Regex Match (RE2) – regex.openverbs.com 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-15).

Finds the first (or all) matches of a RE2 regular expression in a text string, returning each match's text, start/end offsets, and numbered and named capture groups.

## Facts

- Endpoint: POST https://regex.openverbs.com/v1/match
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/regex-match-re2-regex-openverbs-com-c9ac981c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lOzNvUuXonlSu3_ImWdaY

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-match-re2-regex-openverbs-com-c9ac981c -d '<json body>'
```

Example prompt: Scan this server log line with the RE2 pattern `(?P<ip>\d{1,3}(?:\.\d{1,3}){3}) (?P<method>GET|POST|PUT|DELETE)` and give me all matches with their named capture groups — return every match, not just the first.

## When to prefer this

Choose this endpoint when you need structured extraction of regex matches — including capture group values and character offsets — not just a boolean yes/no. Prefer it over the sibling /test endpoint when you need the matched text or group values, and over the sibling /replace endpoint when you want to inspect matches rather than transform the string. The RE2 engine guarantees linear-time matching, making it safe for untrusted or user-supplied patterns.

## Known failure modes

- Invalid RE2 pattern syntax returns an error (RE2 does not support lookaheads or backreferences)
- Input text exceeding 1,000,000 characters is rejected
- Pattern exceeding 4,096 characters is rejected
- Payment failure or insufficient USDC balance returns a 402 error
- Network timeout on very large inputs

## How this service works

Find the first match (or all matches with all=true) of a RE2 pattern, returning each match's text, start/end offsets, and numbered and named capture groups. No match is a successful 200 with an empty match list.

## Output

A JSON object containing a list of match objects. Each match includes the matched text, its start and end character offsets in the input, an array of numbered capture groups, and a map of named capture groups. If no match is found, returns HTTP 200 with an empty list.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "pattern": {
       "type": "string",
       "minLength": 1,
       "maxLength": 4096,
       "description": "RE2 regular-expression pattern."
      },
      "input": {
       "type": "string",
       "maxLength": 1000000,
       "description": "The subject text."
      },
      "flags": {
       "type": "string",
       "maxLength": 8,
       "description": "Any of i (case-insensitive), m (multiline ^$), s (dotall). Default none."
      },
      "all": {
       "type": "boolean",
       "description": "Return every match instead of just the first. Default false."
      }
     },
     "required": [
      "pattern",
      "input"
     ],
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/regex-match-re2-regex-openverbs-com-c9ac981c/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)
