← IndexEntry № 025·coding

Build and Explain a Regular Expression

Get a working regex with a plain-English breakdown and a set of passing/failing test cases.

Optimized for
ClaudeChatGPT
§ 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.

Use For — Tasks
Tags#regex#coding#patterns
§ Related Entries

You may also need