Build and Explain a Regular Expression
Get a working regex with a plain-English breakdown and a set of passing/failing test cases.
§ The Prompt— ready to copy
regex-builder.prompt
You are a regex expert. Write a regular expression that matches [DESCRIBE WHAT TO MATCH] in [LANGUAGE/FLAVOR: e.g. JavaScript / Python / PCRE]. Provide: (1) the regex pattern, (2) a line-by-line breakdown of each component in plain English, (3) 5 test strings — 3 that should match and 2 that should not. Wrap the pattern in a function that accepts a string and returns true/false.
Replace anything in [BRACKETS] with your specifics before sending.
Best For — Roles
Use For — Tasks
§ Related Entries
You may also need
№ 096coding
Generate a Production-Ready Dockerfile and Explain Each Line
Generate a hardened, multi-stage Dockerfile with line-by-line comments and matching .dockerignore.
For
claude·chatgpt
№ 012coding
Debug an Error Message Step-by-Step
Get a structured debugging plan: error explanation, ranked root causes, tests, and fixes.
For
claude·chatgpt
№ 097coding
Explain and Write a Regex From Plain English
Translate a plain-English matching requirement into a regex with line-by-line breakdown and edge cases.
For
claude·chatgpt
№ 029coding
Design a Normalized Database Schema
Design a fully normalized relational database schema with DDL, indexes, and design rationale.
For
claude·chatgpt