Pattern & text-extraction
5 decisions a prompt of this kind should make on purpose, and 5 things worth leaving out. One of them is something only you can supply — we leave it blank rather than let a model invent it.
regex, regular expression, grep, ripgrep, glob, jq, sed, awk, extract, pull out, capture group, match pattern, find all, css selector, xpath, pattern to match, pattern that
- +Tool / dialectName the tool and flavor (JS/PCRE regex, ripgrep, jq, sed); default to PCRE/JS regex and say so.
- _Sample input + what matchesOnly you know this. Give 2 to 3 real example lines and mark exactly what should and should NOT match.
- +Capture vs matchSay whether you need the whole match or specific capture groups, and in what form.
- +Edge casesNote tricky cases: unicode, escaping, multiline, greedy vs lazy, empty input.
- +Output formReturn the pattern first, then one line explaining each part; no surrounding program unless asked.
Left out for this type: code-writing moves (function signature, integration point, error handling); role prompting ('senior engineer'); tone / voice; wrapping a one-line pattern in a full script; prose 'clean and well-structured'