{"uid":"cap_R70c3d8HYd4sAk_bxCTqC","slug":"24k-labs-regex-tester-c79af939","name":"24K Labs Regex Tester","description":"Test a regex against text; returns matches, capture and named groups, and spans.","url":"https://api.24klabs.ai/api/regex-test","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string"},"flags":{"type":"string"},"pattern":{"type":"string"}}},"responseSchema":{"type":"json","example":{"match_count":2}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_GkZPzUNHr1HKz65aXm7YG","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Tests a regular expression pattern against input text and returns full match details including capture groups, named groups, and span positions.","exampleAgentPrompt":"Test this regex pattern `(\\d{4})-(\\d{2})-(\\d{2})` against the text 'Order placed on 2024-03-15, shipped 2024-04-01' and show me all the matches, capture groups, and their positions in the string.","exampleUseCases":[{"title":"Extract dates from log output","prompt":"Run the regex `(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2})` against this server log text and give me all the timestamps it matches along with their positions: 'ERROR 2024-05-01T12:34:56 failed, retrying at 2024-05-01T12:35:10'."},{"title":"Validate named groups in an email parser","prompt":"Test my regex `(?P<user>[\\w.]+)@(?P<domain>[\\w.]+\\.(?P<tld>\\w+))` against 'Contact us at support@example.com or sales@company.org' and show me the named groups for each match."},{"title":"Debug a phone number pattern","prompt":"I'm not sure my regex `(\\+?1[-.\\s]?)?\\(?\\d{3}\\)?[-.\\s]?\\d{3}[-.\\s]?\\d{4}` is working right — can you run it against 'Call 800-555-1234 or +1 (415) 867-5309' and show me every match with its span?"}],"resultDescription":"Returns an array of match objects for each occurrence found in the input text. Each match includes the full matched string, an array of indexed capture groups, a map of named capture groups (if the pattern uses named groups), and the start/end character position (span) of the match within the input text.","failureModes":["Invalid regex pattern returns a parse error describing the syntax issue","No matches found returns an empty matches array rather than an error","Unsupported regex flags may result in an error or be silently ignored","Very large input text or catastrophic backtracking patterns may cause timeout","Malformed request body (missing pattern or text) returns a 400-level error"],"whenToPreferThis":"Choose this endpoint when you need programmatic regex testing with structured output — especially when you need machine-readable span positions, capture groups, or named groups rather than a simple yes/no match check. Ideal for agents that need to extract structured data from unstructured text using patterns, debug regex behavior, or validate regex correctness against sample input. Prefer over generic string search when group extraction or position data is required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T19:02:02.347Z","isFirstParty":false}