{"uid":"cap__Q3gg_-PArNiE3bT_ymK_","slug":"24k-labs-regex-tester-aec1caab","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/v1/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_Bw6xhdQfO53RunwLTmr35","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 against input text and returns all matches, capture groups, named groups, and character span positions.","exampleAgentPrompt":"Test the regex pattern `(?P<year>\\d{4})-(?P<month>\\d{2})-(?P<day>\\d{2})` against this text: 'Order placed on 2024-03-15 and shipped on 2024-04-01' — I want all matches, named groups, and the character spans for each match.","exampleUseCases":[{"title":"Extract dates from a log file","prompt":"Run the regex `(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2})` against this log snippet: '[2024-01-10T08:22:11] ERROR: disk full [2024-01-10T08:23:45] WARN: retry' and give me every match with its position in the string."},{"title":"Validate capture groups in email parser","prompt":"I wrote this email regex: `(?P<user>[\\w.+\\-]+)@(?P<domain>[\\w\\-]+)\\.(?P<tld>[a-z]{2,})` — test it against 'Contact us at support@example.co.uk or sales@company.com' and show me the named groups for each match."},{"title":"Debug pattern for invoice number extraction","prompt":"Can you test the pattern `INV-(?P<year>\\d{4})-(?P<seq>\\d{5})` against the text 'Invoices: INV-2023-00123, INV-2024-00456, REF-2024-00789' and tell me which strings matched, what the capture groups contain, and the exact character spans?"}],"resultDescription":"Returns a structured response containing an array of matches, each with the full matched string, an array of positional capture groups, a map of named capture groups (if any), and the start/end character span within the input text. Also includes a total match count.","failureModes":["Invalid regex syntax returns an error describing the pattern fault","Empty input text returns zero matches","Catastrophic backtracking on complex patterns may time out","Flags not supported by the engine return an error","Pattern with no matches returns an empty matches array"],"whenToPreferThis":"Choose this endpoint when you need to programmatically test or debug a regex pattern against text and require structured output including capture groups, named groups, and span positions — especially useful in agentic workflows where downstream steps need to consume match data. Prefer it over running regex locally when you need a deterministic remote result with span metadata or when building no-code/low-code automation that lacks a native regex engine.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:33:42.474Z","isFirstParty":false}