Hacker News new | ask | show | jobs
by jdoliner 3076 days ago
This is a blacklist though.
1 comments

Functionally - yes. By definition - no.

A blacklist won't allow items that match and a whitelist only allows items that match. Blacklists include by default and whitelists exclude by default.

Since the regex needs to match to be included - it is, by definition, a whitelist. It excludes by default anything that doesn't match. It just so happens the net being cast is so wide as to be "all except ____" where a whitelist is usually seen as "none except ____".

I think part of the definition blacklist and whitelist is being a list.
Think of it as shorthand for a list that expands to be infinitely large. [0]

People would consider a blacklist that includes ` * .example.com` to be a list that contains all potential subdomains of `example.com`. With ` * ` being seen as shorthand.

E: Spaces around the asterisk added to avoid HN formatting.

[0] Technical limitations aside, especially in the context of URL matching since URLs have a maximum character length.

A list of regexes is a list.

A list with one entry is also a list.