Replace matches of a RE2 pattern with a replacement string
Replace matches of a RE2 pattern with a replacement string. Replaces all matches by default (set all=false for first-only). The replacement may reference capture groups with $1, $2 or ${name}. Returns the resulting string.
4000 (raw units)
price
3
calls / 30d
1
unique payers
2026-09-06
updated
Provider
regex.openverbs.com · discovered, not yet claimed by its owner
Payment (x402 accepts[])
[
{
"scheme": "exact",
"network": "eip155:8453",
"payTo": "0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "4000",
"maxTimeoutSeconds": 300
}
]Output schema
{
"bazaar": {
"info": {
"input": {
"body": {
"all": false,
"flags": "example",
"input": "example",
"pattern": "example",
"replacement": "example"
},
"bodyType": "json",
"method": "POST",
"type": "http"
}
},
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"input": {
"additionalProperties": false,
"properties": {
"body": {
"additionalProperties": false,
"properties": {
"all": {
"description": "Replace every match. Default true.",
"type": "boolean"
},
"flags": {
"description": "Any of i (case-insensitive), m (multiline ^$), s (dotall). Default none.",
"maxLength": 8,
"type": "string"
},
"input": {
"description": "The subject text.",
"maxLength": 1000000,
"type": "string"
},
"pattern": {
"description": "RE2 regular-expression pattern.",
"maxLength": 4096,
"minLength": 1,
"type": "string"
},
"replacement": {
"description": "Replacement text; supports $1/${name} group references.",
"maxLength": 1000000,
"type": "string"
}
},
"required": [
"pattern",
"input",
"replacement"
],
"type": "object"
},
"bodyType": {
"enum": [
"json",
"form-data",
"text"
],
"type": "string"
},
"method": {
"enum": [
"POST"
],
"type": "string"
},
"type": {
"const": "http",
"type": "string"
}
},
"required": [
"type",
"method",
"bodyType",
"body"
],
"type": "object"
}
},
"required": [
"input"
],
"type": "object"
}
}
}Use it
curl
curl "https://regex.openverbs.com/v1/replace" # -> 402 Payment Required, accepts[] lists how to pay # retry with a PAYMENT-SIGNATURE (or PAYMENT header) once paid
JavaScript
const res = await fetch("https://regex.openverbs.com/v1/replace");
if (res.status === 402) {
const { accepts } = await res.json();
// pay one of accepts[] via an x402 client, then retry with the payment header
}Python
import httpx
res = httpx.get("https://regex.openverbs.com/v1/replace")
if res.status_code == 402:
accepts = res.json()["accepts"]
# pay one of accepts[] via an x402 client, then retry with the payment headerMachine-readable
Everything on this page is also available as clean JSON at /resources/13746.json, and this resource appears in /discovery/resources and /discovery/search.