Skip to content

Commit 13897c0

Browse files
author
SMKRV
committed
refactor: Enhance Clash list filtering
1 parent 55fc660 commit 13897c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/mikrotik-domain-filter-bash.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,8 @@ extract_domains() {
385385
[[ -z "$line" || "$line" =~ ^[[:space:]]*# ]] && continue
386386

387387
# Extract domain from different formats
388-
if [[ "$line" =~ ^(DOMAIN-SUFFIX|DOMAIN|DOMAIN-KEYWORD),(.+)$ ]]; then
389-
echo "${BASH_REMATCH[2]}" >> "$temp_file"
388+
if [[ "$line" =~ ^[[:space:]]*-?[[:space:]]*(DOMAIN-SUFFIX|DOMAIN|DOMAIN-KEYWORD),(.+)$ ]]; then
389+
echo "${BASH_REMATCH[2]}" | tr -d '[:space:]' >> "$temp_file"
390390
elif [[ "$line" =~ ^[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z]{2,}$ ]]; then
391391
echo "$line" >> "$temp_file"
392392
fi

0 commit comments

Comments
 (0)