#! /bin/bash

re=""
while IFS= read -r line; do
    IFS="#" read -ra  filter <<< "$line"
    if [ -n "$filter" ]; then
	[ -n "$re" ] && re+="|"
	re+=$(echo "$filter" | sed 's/[[:space:]]\+$//')
    fi
done < "filters.txt"

cat - | grep -viP "($re)"
