brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
regex-builderBuild a regular expression from a plain-English description, or explain an existing one. Use when asked to write a regex, match/validate/extract a pattern, or understand what a regex does. Produces the regex, a token-by-token breakdown, passing and failing test cases, and notes on flavor/edge cases.
Independent GitHub snapshot · Automated classification · Original documentation governs
Produce correct, readable regular expressions — and explain them so the user actually understands what they're shipping.
Infer the regex flavor (JavaScript/PCRE/Python/Go) from context; if unstated, default to one and say so (assumed — confirm). Always deliver a working pattern and tests even from a loose description. Never leave placeholders.
re, RE2, grep -E…) — anchors, lookbehind, and Unicode behaviour differ enough to break portability silently.The regex in a code block, plus the flavor and any flags (e.g. i, g, m) and why.
A token-by-token table or list: each part of the pattern and what it matches.
| Token | Matches |
|---|---|
^ | start of string |
| … | … |
Edge cases, catastrophic-backtracking risks, anchoring, Unicode, and a simpler alternative if the regex is getting unwieldy (sometimes "don't use regex" is the right answer — say so).
\d, lookbehind, and named groups differ across engines