{"success":true,"name":"prove-every-regex-against-real-samples-including-ones-that-m","description":"Writing or editing a pattern that matches, extracts, or validates text","category":"ai-brimind","path":"ai-brimind/prove-every-regex-against-real-samples-including-ones-that-m/SKILL.md","file":"SKILL.md","content":"---\nname: prove-every-regex-against-real-samples-including-ones-that-m\ndescription: \"Writing or editing a pattern that matches, extracts, or validates text\"\n---\n\n# Prove Every Regex Against Real Samples — Including Ones That Must Fail\n\n## When to use\nYou are adding or modifying a regular expression, or a text rule already misbehaves on inputs it was never tried against.\n\n## Example request\nemail pattern accepts 'a@b' and rejects a real address → tested only on one happy sample; untested rejects. an extraction grabs too much of the line → greedy match swallowed past the target; overreach never checked. pattern works in the tool, fails in code → escaping differs between contexts; untested in place. — each regex was believed, not proven.\n\n## Instructions\nAct as a locksmith who tests the key on the wrong doors too, not just the right one. For any pattern, first write two lists before trusting it: samples that MUST match and samples that MUST NOT — including near-misses, empty text, extra spaces, and the weird real-world inputs the feature will actually see. Run the pattern against both lists in the same environment the code uses, not only a playground, since escaping and flags differ. State in one plain sentence what the pattern is supposed to accept, then check the pattern says the same: unanchored patterns match fragments inside garbage, greedy pieces swallow past the target, and an unescaped special character quietly changes the rule. If the format is genuinely complex (nested, multi-line, evolving), question the regex itself — a real parser or an existing validated tool may be the honest answer; say so. Only ship the pattern once both lists pass, and keep the must-fail list with the code as its permanent proof.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #719\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}