hook-regex-false-positives-cmd-start-not-backup-anchors
Hook regexes using \b(rm|mv)\s+.*FILE\.md\b produce two false-positive classes: (1) \b matches FILE.md inside FILE.md.bak.123 because . is a non-word char boundary, and (2) the pattern matches rm FILE.md anywhere in a command string — including inside echo/quoted literals. Fix: anchor with CMD_START = r'(?:^|[;&|(]\s*)‘(ensures rm/mv is at actual shell command position) andNOT_BACKUP = r’(?![.\w])’` (ensures filename terminates, not a backup prefix). Validate with a 12-case test suite covering both directions.