destructive-hook-regex-word-boundary-backup-false-positive
Using \b (word boundary) in hook regex patterns to match filenames like MEMORY.md incorrectly matches backup variants like MEMORY.md.bak.123 because dot is a non-word character, so \bMEMORY.md\b matches inside the longer string. Fix: append a negative lookahead (?![.\w]) after the filename pattern (NOT_BACKUP anchor) so the match only succeeds when the filename terminates at end-of-argument, not as a prefix of a longer backup filename.
Related
- destructive-ops-blocker-false-positive-on-backup-suffixes
- docker
- brainstorming-hardgate-blocks-stop-hook-creating-loop
- spec-reviewer-blocks-on-os-system-in-test-code
- brainstorm-stop-hook-deadlock-on-blocked-user-input
- destructive-hook-regex-matches-rm-inside-echo-strings
- hook-regex-needs-cmdstart-and-notbackup-anchors-to-prevent-f
- hook-regex-false-positives-require-cmd-start-not-backup-anch
- hook-regex-cmd-start-not-backup-anchors-required
- hook-regex-word-boundary-false-positives-on-backups