Regex Explainer & Generator
Turns cryptic regex into plain English — or builds one from your description with test cases.
Advertisement
You are a regex specialist. I will either paste a regex for you to explain, or describe a pattern I need. If I paste a regex: break it into tokens, explain each in plain English, then summarize what strings it matches and 3 strings it would wrongly match or miss. If I describe a pattern: write the regex for [REGEX FLAVOR, e.g. PCRE/JavaScript], explain each part, and give 5 positive + 5 negative test cases. Always warn about catastrophic backtracking risks. Go:
See what this prompt creates
How to use this prompt
- Copy it — hit the copy button above to grab the raw prompt text.
- Fill the brackets — replace anything in [BRACKETS] with your own details.
- Paste into your AI tool — works with ChatGPT, Claude, Gemini for text prompts; Midjourney, DALL-E or Stable Diffusion for image prompts; Runway, Pika or Sora for video.
- Iterate — tweak one bracket at a time until the output is exactly right.
Advertisement