{"uid":"cap_MSbwnXpfEcONKWtqb0LZR","slug":"sitecheck-regex-generator-61d4406b","name":"SiteCheck Regex Generator","description":"A regular expression from a description, with examples that must match and examples that must not. The pattern is returned only when every example passes when tested in the service (one retry with the failures). Patterns with nested quantifiers are refused to avoid catastrophic backtracking. Examples are up to 10 strings of 300 characters each.","url":"https://api.sitecheck-api.workers.dev/api/regex/generate?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"matches":{"type":"array","description":"Strings the pattern must match (1-10 items, each max 300 characters)"},"nonMatches":{"type":"array","description":"Strings the pattern must not match (0-10 items, each max 300 characters)"},"description":{"type":"string","description":"What the pattern should match, in plain words (max 500 characters)"}}},"responseSchema":{"type":"json","example":{"note":"Tested only against the examples you gave; it may still match or miss other inputs.","flags":"","tests":{"passed":true,"matches":2,"nonMatches":3},"pattern":"^\\d{5}$","checkedAt":"2026-10-15T18:21:15.842Z","explanation":"The pattern ^\\d{5}$ matches a string that starts with and ends with exactly 5 digits, ensuring a five-digit postal code."}},"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_jjOAzjiQ24n1qoH54iINR","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":"Generates a tested regular expression pattern from example match/non-match strings and a plain-English description","exampleAgentPrompt":"Generate a regex pattern that matches strings like 'INV-2024-0042' and 'INV-1999-9999' but not 'INV-24-42' or 'INVOICE-2024-0042' — it should match invoice IDs with a 4-digit year and 4-digit sequence number.","exampleUseCases":[{"title":"Validate US zip code input","prompt":"I need a regex that matches valid US zip codes like '90210' and '10001' but rejects things like '9021' (too short), '902100' (too long), and 'ABCDE' (not digits). Can you generate one with an explanation?"},{"title":"Match product SKU format","prompt":"Generate a regex pattern for our product SKUs — they look like 'SKU-ABC-001' or 'SKU-XYZ-999', always uppercase letters and 3 digits after the dash, but it should NOT match 'sku-abc-001' (lowercase) or 'SKU-AB-001' (only 2 letters)."},{"title":"Extract ISO 8601 dates from logs","prompt":"I need a regex that matches ISO 8601 date strings like '2024-01-15' and '1999-12-31' but not '2024-1-5' (missing leading zeros) or '2024/01/15' (wrong separator) — give me the pattern and confirm it passes those tests."}],"resultDescription":"Returns a JSON object containing: the generated regex pattern string, optional flags, a plain-English explanation of what the pattern matches, a test summary showing whether all provided match/non-match examples passed, counts of matches and non-matches tested, and a timestamp. A note reminds that the pattern was only verified against the provided examples.","failureModes":["Invalid or contradictory match/non-match examples that cannot be reconciled into a single pattern","Too many or too few examples (outside 1-10 match items)","Examples exceed 300-character limit per string","Description too vague for pattern generation","Pattern generation may produce a pattern that overfits or underfits edge cases not covered by provided examples","Payment failure returns 402 status"],"whenToPreferThis":"Choose this endpoint when you need a tested regex generated from concrete examples rather than writing one by hand. It's especially useful when you can enumerate what should and shouldn't match but can't easily articulate the formal grammar. Prefer it over asking a general LLM for regex because the output is automatically back-tested against your examples and includes a pass/fail report.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-16T12:41:42.026Z","isFirstParty":false,"canonicalSlug":"sitecheck-regex-generator-61d4406b"}