WORK 93 words
Critique a Piece of Regex Before It Goes Into Production
It works on your three test strings and that is not the same as working. This checks the pattern for catastrophic backtracking, the inputs you did not think to test, and whether the next person maintaining it will understand it, then hands back a safer version with the change explained plainly.
Critique this regex before I put it into production. Pattern: [paste the regex] Intended purpose: [what it is meant to match] Sample inputs it should match: [paste a few examples] Sample inputs it should reject: [paste a few examples] Check it against catastrophic backtracking risk, unintended matches on edge cases like empty strings, unicode, or trailing whitespace, and readability for the next person who has to maintain it. If it is fragile, give me a safer version and explain what changed and why in plain terms, not just a wall of regex syntax.
⚠ human-in-the-loop: you are responsible for the results of using this prompt, not us.