{"uid":"cap_-H-9G-v1HqzykF6oND7Tt","slug":"relaystation-regex-extract-d5b119f9","name":"RelayStation Regex Extract","description":"$0.0002/MB. Extract regex matches from text — ReDoS-guarded, patterns and input bounded. 1¢ x402 min; remainder auto-credits — relaystation.ai/penny","url":"https://api.relaystation.ai/v1/text/regex-extract","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","properties":{"file":{"type":"object","description":"cputools input-source: { inline: <base64 ≤ 4 MiB> } or { inputKey: <scratch key from /v1/cputools/upload-url, ≤ 50 MB> }."},"text":{"type":"string","minLength":1},"flags":{"type":"string","pattern":"^[gimsuy]*$","maxLength":8},"pattern":{"type":"string","maxLength":1024,"minLength":1},"maxMatches":{"type":"integer","maximum":100000,"minimum":1}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_urzaZXF7FOkEOztRAmpxS","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Extracts all regex pattern matches from a text string, with ReDoS protection and bounded inputs.","exampleAgentPrompt":"Extract all email addresses from this text using the pattern [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}: 'Please contact support@example.com or sales@acme.org for help. Billing issues go to billing@company.co.uk.'","exampleUseCases":[{"title":"Pull emails from contact page text","prompt":"Find all email addresses in this scraped contact page text using regex — pattern is something like [\\w.+-]+@[\\w-]+\\.[\\w.]+ : 'Reach us at hello@startup.io or press@startup.io. Investors can email ir@startup.io.'"},{"title":"Extract log timestamps for analysis","prompt":"Pull every timestamp from these server log lines using the pattern \\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}: '2024-03-15T08:22:01 ERROR disk full; 2024-03-15T08:23:44 WARN retry; 2024-03-15T08:25:00 INFO ok'"},{"title":"Parse product SKUs from order notes","prompt":"Extract all product SKU codes matching the pattern [A-Z]{2,4}-\\d{4,6} from this order note text: 'Customer ordered AB-1234, requested XYZ-99821 as replacement, and also wants DEMO-4400 if in stock.'"}],"resultDescription":"Returns a JSON array of all matches found in the input text for the given regex pattern, including matched strings and optionally their positions or capture group values. If no matches are found, returns an empty array. ReDoS-guarded execution ensures safe evaluation of user-supplied patterns.","failureModes":["Regex pattern flagged as potentially ReDoS-dangerous — request rejected with an error","Input text exceeds size bound — rejected with payload-too-large error","Malformed regex syntax — returns parse error with description","No matches found — returns empty array (not an error)","Insufficient USDC balance below 1¢ minimum — payment rejected"],"whenToPreferThis":"Choose this endpoint when you need safe, server-side regex extraction without spinning up your own compute — especially useful when the pattern or input is user-supplied and ReDoS risk is a concern. Prefer it over client-side regex when you want bounded, predictable execution in an agentic pipeline. Best for structured field extraction (emails, phone numbers, codes, dates) from unstructured text at low cost.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T06:52:49.240Z","isFirstParty":false}