WORK 67 words
Explain a Regex Pattern Line by Line
Someone wrote this regex two years ago, there are no comments, and you need to change it without breaking validation for everyone. This breaks the pattern down piece by piece, gives you a matching and a non-matching example, and flags anything that looks fragile enough to bite you later.
Here is a regex pattern I found in the codebase and need to understand before I touch it: [paste the regex pattern here]. Explain what it matches, piece by piece, in plain English. Include one example string that would match and one that would not, and flag anything in the pattern that looks fragile or likely to cause unexpected matches, for example greedy quantifiers or missing anchors.
⚠ human-in-the-loop: you are responsible for the results of using this prompt, not us.