Could a missing $ (to check for the end of the line) at the end of the pattern cause some minor issues? Line api.segment.io.blah should not be filtered out in the example below.
cat 1.txt
api.segment.io
x.api.segment.io
api.segment.io.blah
blah
cat tmp.rem.whitelist
^api\.segment\.io\|\.api\.segment\.io
grep -vf tmp.rem.whitelist 1.txt
blah
UPDATE: I have just compared the results and ~2K domains that should have been blacklisted, ended up being excluded. Here are examples:
Whitelisted: microsoft.com
Removed from blacklist: safety.microsoft.com.ruqem.yq7flcfpxhylyajsqc.trade
Whitelisted: apple.com
Removed from blacklist: apple.computersoftwaresecurityinstall.xyz