From d1ddb676f0359a71b57277789fb25994ee7e38d6 Mon Sep 17 00:00:00 2001 From: loyalsoldier Date: Wed, 11 Dec 2019 03:37:02 +0800 Subject: [PATCH] fixed grep regexp --- generate-rules-dat.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generate-rules-dat.sh b/generate-rules-dat.sh index 04f3863..6de44fa 100644 --- a/generate-rules-dat.sh +++ b/generate-rules-dat.sh @@ -41,8 +41,9 @@ echo -e "${GREEN}>>> Finished Chinalist ${NC}" echo -e "${GREEN}>>> generating AdBlock domains list...${NC}" curl -sSL $ADBLOCK_DOMAINS_URL \ - | grep -eov '^(\d{1,3}\.){3}\d{1,3}' \ - | grep -eov '^[^.]$' \ + | grep -Eov '^(\d{1,3}\.){3}\d{1,3}' \ + | grep -Eov '^[^.]+$' \ + | grep -eo '^(([a-zA-Z0-9]+[a-zA-Z0-9-]*)+\.)+[a-zA-Z0-9]{2,}$' \ > $GOPATH/src/$GEOSITE_REPO/data/adblocklist # | grep -eo '^(([a-zA-Z0-9]+[a-zA-Z0-9-]*)+\.)+[a-zA-Z0-9]{2,}$' \