{"uid":"cap_BStrEs5FjBjxNvPBb3qHZ","slug":"wealth-agent-regex-search-43aba9d5","name":"Wealth Agent Regex Search","description":"Apply one regular expression to a text blob on the server and return every match with its index and capture groups. Deterministic, so the same input always returns the same answer. Useful for log triage, field extraction and validation at scale.","url":"https://wealth-agent.wealthagent-app.workers.dev/api/x402/regex?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["pattern","text"],"properties":{"text":{"type":"string","description":"Text to search (max 20,000 chars)"},"flags":{"type":"string","description":"g, i, m, s, u, y (optional)"},"pattern":{"type":"string","description":"Regular expression (max 200 chars)"}}}}},"output":{"type":"object","properties":{"type":{"type":"string"},"example":{"type":"object","required":["ok","resource","status","deliverable"],"properties":{"ok":{"type":"boolean"},"tx":{"type":["string","null"]},"note":{"type":"string"},"error":{"type":["string","null"]},"job_id":{"type":["string","null"]},"status":{"enum":["delivered","paid_not_delivered"],"type":"string"},"resource":{"type":"string"},"receipt_id":{"type":["string","null"]},"deliverable":{"type":["object","null"],"required":["kind","summary"],"properties":{}}}}}}}},"responseSchema":{"type":"json","example":{"kind":"regex","count":2,"matches":[{"index":0,"match":"ERROR timeout","groups":["timeout"]}]}},"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_bjk0D_2h-WT60SIVULn2P","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":"Runs a regular expression pattern against provided text and returns all matches with their positions and capture groups","exampleAgentPrompt":"Search this log output for any lines containing 'ERROR' followed by a word, using the pattern 'ERROR (\\w+)' with the global flag — the text is: 'ERROR timeout\\nINFO ok\\nERROR crashed'","exampleUseCases":[{"title":"Log error extraction from server output","prompt":"I have this server log and I need you to find every line that starts with ERROR and capture the error type — use the pattern '^ERROR (\\w+)' with multiline and global flags on this text: 'ERROR timeout\\nINFO healthy\\nERROR out_of_memory\\nDEBUG tick'"},{"title":"Extract all email addresses from text","prompt":"Pull out every email address from this block of text using a regex — pattern '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}' with the global flag: 'Contact us at support@example.com or sales@company.org for help.'"},{"title":"Validate phone number format in user input","prompt":"Check whether this text contains any US phone numbers matching the pattern '\\(?\\d{3}\\)?[-.\\s]?\\d{3}[-.\\s]?\\d{4}' — just search: 'Call me at 555-867-5309 anytime'"}],"resultDescription":"Returns a JSON object with the total match count, and an array of match objects each containing the matched string, its character index in the original text, and any captured groups from parentheses in the pattern.","failureModes":["Invalid regex pattern returns an error response","Text exceeding 20,000 characters is rejected","Pattern exceeding 200 characters is rejected","Invalid flag characters cause a parse error","Payment not confirmed results in paid_not_delivered status","No matches found returns an empty matches array with count 0"],"whenToPreferThis":"Choose this endpoint when you need server-side regex execution without running code locally, when the agent environment lacks a code interpreter, or when you want a pay-per-call regex service with structured match output including group captures and character indices. Prefer over client-side execution when you need auditable, reproducible text extraction with receipt tracking.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-19T12:36:41.990Z","isFirstParty":false,"canonicalSlug":"wealth-agent-regex-search-43aba9d5"}