{"uid":"cap_alI9DFWyJjYUKGK0hxpOa","slug":"saylor-innovations-regex-tester-813cb0df","name":"Saylor Innovations Regex Tester","description":"Regex tester - matches, capture groups and named groups for a JavaScript pattern against text","url":"https://saylorinnovations.com/api/regex/test?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","maxLength":5000,"description":"Text to search, max 5,000 characters"},"flags":{"type":"string","default":"g","pattern":"^[gimsuyd]{0,7}$","description":"Regex flags from g i m s u y d, each at most once (default g)"},"pattern":{"type":"string","examples":["(\\d{4})-(\\d{2})-(\\d{2})","\\b[A-Z][a-z]+\\b"],"maxLength":500,"description":"JavaScript regular expression source without slashes, max 500 characters"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","required":["pattern","matched","match_count","matches"],"properties":{"flags":{"type":"string","description":"Flags that were applied"},"engine":{"type":["string","null"],"description":"Engine or model that produced the result"},"matched":{"type":"boolean","description":"True when at least one match was found"},"matches":{"type":"array","items":{"type":"object","properties":{"end":{"type":"number","description":"End offset (exclusive)"},"index":{"type":"number","description":"Start offset in the input"},"match":{"type":"string","description":"The matched text"},"named":{"type":["object","null"],"description":"Named capture groups, or null"},"captures":{"type":"array","items":{"type":["string","null"]},"description":"Numbered capture groups, null when unmatched"}}},"description":"Up to 100 matches in order"},"pattern":{"type":"string","description":"The pattern that was tested"},"truncated":{"type":"boolean","description":"True when more than 100 matches were found"},"checked_at":{"type":["string","null"],"description":"Time the check was run (UTC)"},"match_count":{"type":"number","description":"Total matches found (before truncation)"},"text_length":{"type":["number","null"],"description":"Text length"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.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_tlOrmVxIdEBLl9V6X57Au","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Tests a JavaScript regular expression against text and returns all matches, capture groups, and named groups","exampleAgentPrompt":"Test the JavaScript regex pattern (\\d{4})-(\\d{2})-(\\d{2}) with the global flag against this text: 'Invoice date: 2024-03-15, due by 2024-04-01. Paid on 2023-12-31.' and show me all the matches and their capture groups.","exampleUseCases":[{"title":"Extract dates from document text","prompt":"Run the regex (\\d{4})-(\\d{2})-(\\d{2}) with the global flag against this paragraph: 'Project started 2023-06-01, milestone hit 2023-09-15, delivered 2024-01-20.' — I want each match and its year, month, day capture groups."},{"title":"Find all capitalized words in a passage","prompt":"Use the pattern \\b[A-Z][a-z]+\\b with global flag on this text: 'Alice and Bob met Charlie at the London office near the Thames.' and return every match with its position in the string."},{"title":"Debug named capture group regex","prompt":"Test my regex (?P<user>[\\w.+-]+)@(?P<domain>[\\w-]+\\.[\\w.]+) against the text 'Contact support@example.com or sales@company.co.uk for help.' and show me the named capture groups for each match."}],"resultDescription":"A JSON object containing the original pattern, the flags applied, a boolean indicating whether any match was found, the total match count, a truncated flag if more than 100 matches exist, and an array of up to 100 match objects each with the matched text, start/end character offsets, numbered capture groups (null for unmatched groups), and named capture groups (null if none defined).","failureModes":["Invalid regex pattern causes a parse error response","Flags string contains invalid or repeated characters","Text exceeds 5,000 character limit returns a validation error","Pattern exceeds 500 character limit returns a validation error","Missing required query parameters (pattern or text) returns an error","Pattern matches more than 100 times — result is truncated and truncated flag is set to true"],"whenToPreferThis":"Choose this endpoint when you need JavaScript-flavored regex semantics (including named capture groups, Unicode mode, sticky flag) and want structured per-match results with character offsets and capture group arrays, rather than a simple boolean match check or a server-side language-specific regex engine.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-17T12:41:23.974Z","isFirstParty":false,"canonicalSlug":"saylor-innovations-regex-tester-813cb0df"}