Replace static host list with regexp automatically


#1

Hi,

If I have understood correctly, this tool https://github.com/noprompt/frak transforms collections of strings into regular expressions.

That would be awful to have this function implemented in order to reduce the size of blacklist.


#2

Regex is slower then gravity.list (blocklist is hashed) and this is discussed on several occasions.

When adding to Blackist, not blocklist, you have choice to have is just straight on the blacklist or have it converted to a wildcard or go for the full Regex power if you know how.

I run one every import to gravity.list a filter that removes domains from that list because they are already covered in Regex. Thanks to an mmotti I also automaticly filter out domains that have more than 20 subdomains in the gravity.list and are put in the Regex file.

More then twenty is the point were Regex is faster then a hashed gravity.list file.


#3

Slower, yes, but it is easier to block using regexp as you may not be aware about all the existing hostname to block.

gravity uses much more memory also (I am using Pi one), regexp allows blocking more with less :slight_smile:


#4

I have added a part to my earlier reply that covers that part.

Earlier discussions:
https://discourse.pi-hole.net/t/reduce-size-gravity-list-with-active-wildcard-and-regex-entries/10698/7