Regex generator
Describe what you want to match in plain English and get a pattern back with a piece-by-piece explanation and test cases. Or paste a regex someone else wrote and have it explained.
Your pattern will appear here. Prefer a tested pattern? These are hand-checked:
Email addressPhone numberURLIPv4 addressDate (YYYY-MM-DD)Time (24-hour)
Getting a good pattern out of it
- Say what should fail, too. "Match a UK postcode but not a bare outward code like SW1" gets a tighter answer than "UK postcode".
- Say whether it validates a whole value or finds matches inside text. That decides whether the pattern is wrapped in
^…$. - Paste example text. Real log lines or CSV rows beat any description.
- Pick the right flavor. Named groups, lookbehind and Unicode classes differ between engines.
The explain mode is useful for code review: paste the pattern from a pull request and it lists each token, then flags edge cases and patterns that could backtrack catastrophically. For a quick token-by-token reading without AI, the regex tester does it instantly.
Questions
How does the regex generator work?
Your description is sent to a large language model (OpenAI GPT-6 Luna via Vercel AI Gateway) with instructions to return a pattern, how it works, examples that should and should not match, and caveats. The answer streams back and you can open the pattern in the live tester.
Can I trust the generated regex?
Treat it as a strong first draft. Always paste real samples into the tester, including ones that should fail. For common formats, the hand-tested patterns in the pattern library are a safer start.
Which flavors are supported?
JavaScript, Python, PCRE (PHP, grep -P), Go (RE2) and Java. The assistant is told which features each flavor lacks — for example, Go has no lookarounds or backreferences.
Is it free? Is there a limit?
Free, no account. To keep it that way there is a limit of 20 requests per 10 minutes per visitor and 600 characters per description.
What happens to what I type?
It goes to the model provider through Vercel AI Gateway to produce the answer and is not stored by RegexKit. Your last 10 prompts are kept in your own browser so you can re-run them; clear them on the privacy page.