Catalog/util-regex

Utilities

Regex test & extract API

Run a regular expression over text to test, find a match, or extract all matches with capture groups. Answers 'extract all emails from this text', 'does this match the pattern', 'find all matches'.

Price$0.01per request
MethodPOST
Route/v1/util/regex
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
utilregexregexpextractmatchpatterntext
API URLhttps://x402.hexl.dev/v1/util/regex
Integration docs
Example request
{
  "pattern": "\\d+",
  "text": "a1b22c333",
  "op": "matchAll"
}
Example response
{
  "op": "matchAll",
  "matched": true,
  "count": 3,
  "matches": [
    {
      "match": "1",
      "index": 1,
      "groups": []
    }
  ]
}
Input schema
{
  "type": "object",
  "required": [
    "pattern",
    "text"
  ],
  "properties": {
    "pattern": {
      "type": "string"
    },
    "text": {
      "type": "string",
      "maxLength": 5000
    },
    "flags": {
      "type": "string",
      "examples": [
        "gi"
      ]
    },
    "op": {
      "type": "string",
      "enum": [
        "test",
        "match",
        "matchAll"
      ],
      "default": "matchAll"
    }
  }
}
Output schema
{
  "type": "object",
  "required": [
    "op",
    "matched",
    "matches",
    "count"
  ],
  "properties": {
    "op": {
      "type": "string"
    },
    "matched": {
      "type": "boolean"
    },
    "count": {
      "type": "number"
    },
    "matches": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    }
  }
}