{"uid":"cap_Y4BkGiGykuM-fcjA78-O9","slug":"compute-api-regex-match-3470d9ae","name":"Compute API – Regex Match","description":"Pure computation endpoints paid per call via x402 ($0.001 USDC on Base).","url":"https://compute-api-production-245d.up.railway.app/regex?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["test","pattern"],"properties":{"test":{"type":"string","description":"String to test against"},"flags":{"type":"string","description":"Regex flags, e.g. gi"},"pattern":{"type":"string","description":"Regex pattern (no slashes)"}}},"responseSchema":{"type":"object","properties":{"match":{"type":"boolean"},"groups":{"type":"array","items":{"type":"array","items":{"type":["string","null"]}}},"matches":{"type":"array","items":{"type":"string"}}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_pRPJCj8x42vIX5RcuZsyU","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Tests a string against a regex pattern and returns match status, matched substrings, and capture groups","exampleAgentPrompt":"Test whether the string 'user@example.com' matches the regex pattern '[\\w.+-]+@[\\w-]+\\.[a-z]{2,}' using the 'i' flag, and tell me if it matches and what the capture groups are.","exampleUseCases":[{"title":"Email format validation","prompt":"Check if the string 'hello@world.org' matches the pattern '[\\w.+-]+@[\\w-]+\\.[a-z]{2,}' — I need to know if it's a valid email format and what parts it captures."},{"title":"Extracting version numbers from logs","prompt":"Run the regex pattern '(\\d+)\\.(\\d+)\\.(\\d+)' against the string 'Deployed app v2.14.3 successfully' and give me all the matched groups so I can extract the version number."},{"title":"Case-insensitive keyword detection","prompt":"Test if the string 'Error: Connection Refused on port 8080' contains the word 'error' using the pattern 'error' with the 'gi' flag, and return all matches."}],"resultDescription":"Returns a JSON object with: 'match' (boolean indicating whether the pattern matched), 'matches' (array of matched substrings found in the input), and 'groups' (array of capture group arrays for each match, entries may be null for unmatched optional groups).","failureModes":["Invalid regex pattern syntax causes a 400/500 error response","Missing required fields 'test' or 'pattern' returns a validation error","Unsupported or malformed regex flags may cause errors","Payment failure or insufficient USDC balance on Base returns a 402 error","Catastrophic backtracking on complex patterns against long strings may cause timeout"],"whenToPreferThis":"Use this endpoint when you need server-side regex evaluation without running code locally, especially in agent workflows where executing arbitrary code is not available. Ideal for validating user input formats (emails, phone numbers, URLs), extracting structured data from unstructured text, or checking log lines against patterns. At $0.001 per call it is cost-effective for low-to-moderate volume use cases that need pay-per-call billing via x402 on Base with no subscription required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T18:36:25.039Z","isFirstParty":false,"canonicalSlug":"compute-api-regex-match-3470d9ae"}