{"uid":"cap_o8i3IvFadkmptvEuCHo7x","slug":"api-strale-io-c602f0ef","name":"Strale Regex Generator","description":"Describe what you want to match in natural language, get a tested regex back. Optionally provide test strings for validation.","url":"https://api.strale.io/x402/regex-generate?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","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["description"],"properties":{"description":{"type":"string","description":"What to match in natural language"},"test_strings":{"type":"array","description":"Optional strings to test against"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"description":"Match email addresses in standard format (name@domain.extension)","test_strings":["user@example.com","john.doe@company.co.uk","invalid.email@","notanemail"]},"response":{"_meta":{"payment":{"method":"x402","price_usd":0.054000000000000006,"settlement_id":"0x11740b0ebf3fee3b3a058f50d37e67f110b9ee54317888c6df2a49abda2547ee"},"capability":"regex-generate","latency_ms":1784,"provenance":{"source":"claude-haiku","fetched_at":"2026-06-13T04:25:16.054Z"}},"flags":"g","regex":"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$","explanation":"^ = start of string; [a-zA-Z0-9._%+-]+ = one or more valid email name characters; @ = literal @; [a-zA-Z0-9.-]+ = domain name with letters, numbers, dots, hyphens; \\. = literal dot; [a-zA-Z]{2,} = extension with 2+ letters; $ = end of string","test_results":[{"input":"user@example.com","match":"user@example.com","matches":true},{"input":"john.doe@company.co.uk","match":"john.doe@company.co.uk","matches":true},{"input":"invalid.email@","match":null,"matches":false},{"input":"notanemail","match":null,"matches":false}]}},"exampleRequest":{"description":"Match email addresses in standard format (name@domain.extension)","test_strings":["user@example.com","john.doe@company.co.uk","invalid.email@","notanemail"]},"tags":["x402"],"displayCostAmount":"0.054001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.054001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.054","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.054","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Ul73icZyjlz5FP7BdcvPN","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.054","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts a natural language description into a tested, production-ready regular expression, with optional validation against provided test strings","exampleAgentPrompt":"Give me a tested regex that matches US phone numbers in the formats (555) 123-4567, 555-123-4567, and +1-555-123-4567, and validate it against these strings: '(212) 555-1234', '555-867-5309', 'not-a-phone'.","exampleUseCases":[{"title":"Email validation for signup forms","prompt":"I need a regex that validates email addresses for our user registration. It should accept standard formats like user@domain.com and user+tag@subdomain.co.uk, but reject invalid ones like missing-at-sign.com or @nodomain.test. Can you build and test it against these: 'john.doe@example.com', 'invalid.email@', 'user+filter@company.co.uk'?"},{"title":"Credit card format detection pipeline","prompt":"Build me a regex that identifies valid credit card numbers - Visa, Mastercard, and American Express patterns. Visa and Mastercard should be 16 digits, Amex 15 digits, all with optional spaces or dashes between groups. Test it against: '4532-1234-5678-9010', '378282246310005', 'invalid-card-1234', '5555 5555 5555 4444'."},{"title":"ISO date extraction from documents","prompt":"I need a regex to find and extract ISO 8601 date formats from compliance documents. It should match dates like 2024-01-15, 2023-12-31T14:30:00Z, but not invalid dates like 2024-13-45 or 2023/01/15. Can you create and validate it with: '2024-01-15', '2024-01-15T09:30:00Z', '2023-13-01', 'Jan 15, 2024'?"}],"resultDescription":"A production-ready regular expression pattern matching the described criteria, along with validation results showing whether the regex correctly matches or rejects each provided test string","failureModes":["Ambiguous description may produce a regex that partially matches intent — provide test strings to reduce ambiguity","Very complex patterns may have edge cases not covered — caller should supply representative test strings","If no valid regex can be constructed from the description, an error or empty result is returned"],"whenToPreferThis":"Choose this endpoint when you need to quickly generate a regex from a plain English description without writing it manually, especially when you can provide test strings to verify correctness. Ideal for developers, data pipelines, or AI agents that need dynamic pattern matching without embedding regex expertise.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T18:48:50.998Z","isFirstParty":false,"canonicalSlug":"api-strale-io-c602f0ef"}