# regex.openverbs.com RE2 Split

> regex.openverbs.com RE2 Split 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).

Splits a text string into parts wherever a RE2 regular expression pattern matches, returning an array of substrings and the count of parts.

## Facts

- Endpoint: POST https://regex.openverbs.com/v1/split
- 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/regex-openverbs-com-re2-split-7a11b1d2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rcy29Hk3BoBFd6Aap8otY

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-openverbs-com-re2-split-7a11b1d2 -d '<json body>'
```

Example prompt: Split this log line '2024-01-15 ERROR [auth] Connection timeout after 30s' on whitespace using the RE2 pattern \\s+ and give me back all the parts.

## When to prefer this

Choose this endpoint when you need to split text using a regular expression pattern rather than a fixed literal string, especially when delimiter complexity requires regex (e.g. variable whitespace, alternation, character classes). Prefer it over simple string-split utilities when you need RE2's guaranteed linear-time safety (no catastrophic backtracking), a configurable part limit, or optional case-insensitive/multiline/dotall flags. Best for structured text parsing, log tokenization, or any scenario where delimiter patterns vary.

## 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 string exceeding 4,096 characters is rejected
- Limit value outside 0–100,000 is rejected
- Missing required 'pattern' or 'input' fields returns a validation error
- Payment failure or insufficient balance returns a 402 response

## How this service works

Split the input into parts on each match of a RE2 pattern. An optional limit caps the number of parts (0 = unlimited). Returns the parts array and its count.

## Output

Returns a JSON object containing a 'parts' array of substring strings (the pieces of the input text between pattern matches) and a 'count' integer indicating how many parts were produced. If limit is set, at most that many parts are returned, with any remaining text folded into the last part.

## 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."
      },
      "limit": {
       "type": "integer",
       "minimum": 0,
       "maximum": 100000,
       "description": "Maximum number of parts. 0 or omitted = unlimited."
      }
     },
     "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-openverbs-com-re2-split-7a11b1d2/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)
