diff --git a/.githooks/pre-commit b/.githooks/pre-commit
index 3ae5c2a03a4045e13a7c805b0d0f9e9ab2e759a0..5b1b95564ae0dd230b0a12749a8e7d015641eeea 100755
--- a/.githooks/pre-commit
+++ b/.githooks/pre-commit
@@ -121,7 +121,7 @@ mode_looks_exe() {
 		*.exe) return 0 ;;
 		*.com) return 0 ;;
 	esac
-	git cat-file blob "$2" | head -1 | grep "^#\!/" > /dev/null
+	git cat-file blob "$2" | head -1 | grep "^#\!\s*/" > /dev/null
 }
 mode_not_exe () {
 	echo "The file '$file' has looks executable but does not have an executable mode."