Skip to content

Commit

Permalink
refactor: Enhance Clash list filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
SMKRV committed Jan 31, 2025
1 parent 55fc660 commit 13897c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/mikrotik-domain-filter-bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ extract_domains() {
[[ -z "$line" || "$line" =~ ^[[:space:]]*# ]] && continue

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

0 comments on commit 13897c0

Please sign in to comment.