{"uid":"cap_hA56cs2PQ4lQKwcQgXrYb","slug":"regex-search-on-text-a5dcfb6e","name":"Regex Search on Text","description":"Apply a regex to text and return all matches + capture groups (deterministic; LLMs guess regex wrong). Send { pattern, text, flags? }.","url":"https://x402-services-production.up.railway.app/api/regex","method":"POST","headers":{},"bodySchema":{"type":"object","required":["pattern","text"],"properties":{"text":{"type":"string","description":"Text to search (<=100k chars)"},"flags":{"type":"string","description":"Regex flags, e.g. gi"},"pattern":{"type":"string","description":"Regular expression"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_MUI9QPddN5Pa3sZ3b4jXN","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Applies a regular expression pattern to a block of text and returns matches, using pay-per-call stablecoin payment via x402.","exampleAgentPrompt":"Search this 50,000-character log file for all lines containing an IP address pattern — use the regex \\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b with global and multiline flags.","exampleUseCases":[{"title":"Extract emails from scraped webpage","prompt":"Here's the raw HTML text from a webpage — can you extract every email address from it using a regex like [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,} with global flag?"},{"title":"Find dates in a legal document","prompt":"I have this 80,000-character legal contract text — search it for all date patterns matching \\d{1,2}/\\d{1,2}/\\d{4} using the global flag and tell me every match you find."},{"title":"Validate log lines for error codes","prompt":"Scan this server log text for any lines that match the pattern ERROR:\\s+\\d{3} using global and case-insensitive flags so I can see all the error entries."}],"resultDescription":"Returns the matches found by applying the given regular expression (with optional flags) to the provided text — typically an array of matched strings or substrings, possibly with positions or groups depending on implementation.","failureModes":["Invalid regex pattern causes a parse error response","Text exceeds 100,000 character limit returns a validation error","Malformed flags string causes rejection","No matches found returns an empty result set","Payment not included or insufficient stablecoin payment returns HTTP 402"],"whenToPreferThis":"Use this endpoint when you need server-side regex execution on large text blobs (up to 100k chars) without managing your own compute, and when you are already operating in a pay-per-call stablecoin (x402) environment. Prefer it for quick, stateless pattern-matching tasks where spinning up local code execution is impractical.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:01:57.913Z","isFirstParty":false}