From 2a6e8940df53f8f0a930cfd7fbff18246fe4bd65 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <Joerg.Sachse@slub-dresden.de>
Date: Mon, 21 Dec 2020 11:27:19 +0100
Subject: [PATCH] fix: escape dash in IP regex properly

---
 .githooks/pre-commit | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.githooks/pre-commit b/.githooks/pre-commit
index cfd5a55..b5975f0 100755
--- a/.githooks/pre-commit
+++ b/.githooks/pre-commit
@@ -103,7 +103,7 @@ echo "SUCCESS: URL detection stage."
 
 ### IP address detection stage
 # This is pretty basic regex matching, but it's a start.
-IP_REGEX='[^:alpha:\-/][0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'
+IP_REGEX='[^a-zA-ZäöÜÄÖÜß/\\\-][0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'
 ${GREP_CMD} ${GREP_EXCLUDES} -e "${IP_REGEX}" "${REPOPATH}" | grep -v "127.0.0"
 if [[ ${?} -eq 0 ]]; then
 	echo "ERROR: found IP address."
-- 
GitLab