{"openapi":"3.1.0","info":{"title":"Regular Expressions","version":"0.1.0","description":"ReDoS-safe regular expressions powered by RE2 — test, find matches with numbered and named capture groups, replace, and split. RE2 guarantees linear-time evaluation, so untrusted patterns can never cause catastrophic backtracking.","x-guidance":"ReDoS-safe regular expressions powered by RE2 — test, find matches with numbered and named capture groups, replace, and split. RE2 guarantees linear-time evaluation, so untrusted patterns can never cause catastrophic backtracking. Each operation is an HTTP POST to its /v1/<operation> path with a JSON request body (see each operation's requestBody schema) and returns a JSON response. Endpoints are paid per successful call via x402 or MPP (USDC on Base); an unpaid request returns 402 with payment metadata in the WWW-Authenticate header.","contact":{"email":"hello@openverbs.com"}},"x-discovery":{"ownershipProofs":["0xb1401a71756f51464a9962db12f1eb3e9522490cd20010b06d00cf7b7770acfd5f79721f9dfdf2643f8cecd29af3bde9ec133941a386042b32d9886053a70de61b","0xc1c1f11793e18a00fcb7072421f26e89fb75b6aa517fa84370564991f4b10efa024f6f57e4e67eefd20cf46cc01fc5a62d793fa8fbcda04f26c946a3433d73f91b","0x676b474af0ef9ed4809b5d12d2e789b36e52d56215b21f601d71f76620e36ec630347116a7b2b349a3c3681e5db0fbfa76c4169a676b6d6f27864d0e5017284a1c","0xc2ab96522515ed9e9bc4f1a241b774bd48df42e951ddbf7f6aa8fc76f5a96a20421703e1ec402ce7eb1e4eabea3b6e4e4129cf39d56ea91cf4fcf38561fc94fc1c"]},"servers":[{"url":"https://regex.openverbs.com"}],"paths":{"/health":{"get":{"summary":"Health check","security":[],"responses":{"200":{"description":"Healthy","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"service":{"type":"string"},"version":{"type":"string"}}}}}}}}},"/v1/test":{"post":{"summary":"Test for a match","description":"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. Paid endpoint (x402 + MPP). Price: $0.004000 USDC per successful payment.","tags":["test regex","regex match boolean","check pattern match","re2 test api","validate regular expression match","safe regex test"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"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."}},"required":["pattern","input"],"additionalProperties":false},"example":{"pattern":"\\bcat\\b","input":"The cat sat on the mat.","flags":"i"}}}},"responses":{"200":{"description":"`{ matched }`.","content":{"application/json":{"schema":{"type":"object","description":"`{ matched }`."}}}},"400":{"description":"Invalid request; no payment is attempted"},"402":{"description":"Payment required; x402/MPP metadata returned in headers"},"502":{"description":"Upstream provider error after payment verification"}},"x-payment-info":{"amount":"4000","currency":"0x20c000000000000000000000b9537d11c60e8b50","description":"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.","method":"tempo","preferredOffer":"mpp-tempo","price":{"mode":"fixed","currency":"USD","amount":"0.004000"},"protocols":[{"x402":{"scheme":"exact","network":"eip155:8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}},{"mpp":{"method":"evm","intent":"charge","network":"8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}},{"mpp":{"method":"tempo","intent":"charge","network":"4217","currency":"0x20c000000000000000000000b9537d11c60e8b50","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}}],"network":"4217","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A","offers":[{"amount":"4000","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","description":"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.","intent":"charge","method":"evm","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"},{"amount":"4000","currency":"0x20c000000000000000000000b9537d11c60e8b50","description":"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.","intent":"charge","method":"tempo","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}]}}},"/v1/match":{"post":{"summary":"Find matches and capture groups","description":"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. Paid endpoint (x402 + MPP). Price: $0.004000 USDC per successful payment.","tags":["find regex matches","regex capture groups","extract pattern matches","named group lookup","re2 match api","regular expression search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"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},"example":{"pattern":"([A-Za-z]+)","input":"Ada Lovelace","all":true}}}},"responses":{"200":{"description":"`{ matched, count, matches:[{ match, start, end, groups }] }`.","content":{"application/json":{"schema":{"type":"object","description":"`{ matched, count, matches:[{ match, start, end, groups }] }`."}}}},"400":{"description":"Invalid request; no payment is attempted"},"402":{"description":"Payment required; x402/MPP metadata returned in headers"},"502":{"description":"Upstream provider error after payment verification"}},"x-payment-info":{"amount":"4000","currency":"0x20c000000000000000000000b9537d11c60e8b50","description":"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.","method":"tempo","preferredOffer":"mpp-tempo","price":{"mode":"fixed","currency":"USD","amount":"0.004000"},"protocols":[{"x402":{"scheme":"exact","network":"eip155:8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}},{"mpp":{"method":"evm","intent":"charge","network":"8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}},{"mpp":{"method":"tempo","intent":"charge","network":"4217","currency":"0x20c000000000000000000000b9537d11c60e8b50","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}}],"network":"4217","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A","offers":[{"amount":"4000","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","description":"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.","intent":"charge","method":"evm","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"},{"amount":"4000","currency":"0x20c000000000000000000000b9537d11c60e8b50","description":"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.","intent":"charge","method":"tempo","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}]}}},"/v1/replace":{"post":{"summary":"Replace matches","description":"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. Paid endpoint (x402 + MPP). Price: $0.004000 USDC per successful payment.","tags":["regex replace","replace pattern matches","regular expression substitution","capture group replacement","re2 replace api","safe regex replace"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pattern":{"type":"string","minLength":1,"maxLength":4096,"description":"RE2 regular-expression pattern."},"input":{"type":"string","maxLength":1000000,"description":"The subject text."},"replacement":{"type":"string","maxLength":1000000,"description":"Replacement text; supports $1/${name} group references."},"flags":{"type":"string","maxLength":8,"description":"Any of i (case-insensitive), m (multiline ^$), s (dotall). Default none."},"all":{"type":"boolean","description":"Replace every match. Default true."}},"required":["pattern","input","replacement"],"additionalProperties":false},"example":{"pattern":"\\s+","input":"Ada   Lovelace","replacement":" ","all":true}}}},"responses":{"200":{"description":"`{ result }`.","content":{"application/json":{"schema":{"type":"object","description":"`{ result }`."}}}},"400":{"description":"Invalid request; no payment is attempted"},"402":{"description":"Payment required; x402/MPP metadata returned in headers"},"502":{"description":"Upstream provider error after payment verification"}},"x-payment-info":{"amount":"4000","currency":"0x20c000000000000000000000b9537d11c60e8b50","description":"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.","method":"tempo","preferredOffer":"mpp-tempo","price":{"mode":"fixed","currency":"USD","amount":"0.004000"},"protocols":[{"x402":{"scheme":"exact","network":"eip155:8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}},{"mpp":{"method":"evm","intent":"charge","network":"8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}},{"mpp":{"method":"tempo","intent":"charge","network":"4217","currency":"0x20c000000000000000000000b9537d11c60e8b50","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}}],"network":"4217","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A","offers":[{"amount":"4000","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","description":"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.","intent":"charge","method":"evm","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"},{"amount":"4000","currency":"0x20c000000000000000000000b9537d11c60e8b50","description":"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.","intent":"charge","method":"tempo","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}]}}},"/v1/split":{"post":{"summary":"Split by a pattern","description":"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. Paid endpoint (x402 + MPP). Price: $0.004000 USDC per successful payment.","tags":["regex split","split by pattern","regular expression delimiter","re2 split api","tokenize text with regex","split text safely"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"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},"example":{"pattern":",\\s*","input":"red, green, blue","limit":0}}}},"responses":{"200":{"description":"`{ parts, count }`.","content":{"application/json":{"schema":{"type":"object","description":"`{ parts, count }`."}}}},"400":{"description":"Invalid request; no payment is attempted"},"402":{"description":"Payment required; x402/MPP metadata returned in headers"},"502":{"description":"Upstream provider error after payment verification"}},"x-payment-info":{"amount":"4000","currency":"0x20c000000000000000000000b9537d11c60e8b50","description":"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.","method":"tempo","preferredOffer":"mpp-tempo","price":{"mode":"fixed","currency":"USD","amount":"0.004000"},"protocols":[{"x402":{"scheme":"exact","network":"eip155:8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}},{"mpp":{"method":"evm","intent":"charge","network":"8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}},{"mpp":{"method":"tempo","intent":"charge","network":"4217","currency":"0x20c000000000000000000000b9537d11c60e8b50","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}}],"network":"4217","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A","offers":[{"amount":"4000","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","description":"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.","intent":"charge","method":"evm","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"},{"amount":"4000","currency":"0x20c000000000000000000000b9537d11c60e8b50","description":"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.","intent":"charge","method":"tempo","recipient":"0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A"}]}}}},"x-service-info":{"categories":["text"],"docs":{"homepage":"https://regex.openverbs.com","apiReference":"https://regex.openverbs.com/openapi.json"}}}