Complex RegEx "Not a valid domain"

Hey everyone,
I'm having trouble adding a complex regex for various blocking rules.

Initially, I had a large list of domains in individual rules, but enabling/disabling them every hour or two was becoming tedious. So, I've created a RegEx to cover all the domains I need to turn on and off regularly so I only ever have to activate/deactivate a single rule for the whole list.

The Regex is:

(\.|^)(youtu\.be$|(googlevideo|youtube(i?\.googleapis|-nocookie)?|ytimg(\.l\.google)?)\.com)$

and it blocks:

 youtube.com
 youtu.be
 youtube-nocookie.com
 youtube.googleapis.com
 youtubei.googleapis.com
 ytimg.com
 ytimg.l.google.com

It can be fully tested and verified here: https://regexr.com/5c9ph

However, when I try to add this regex to the blacklist I get the error:

Domain (\.|^)(youtu\.be$|(googlevideo|youtube(i?\.googleapis|-nocookie)?|ytimg(\.l\.google)?)\.com)$ is not a valid domain.

I've tried shorter and less complex versions (e.g. dropping the 'youtu.be' variant) but with no success.

Any advice?
Are standard PCRE regex's filtered for some kind of additional validity I'm not expecting?

Thanks in advance everyone.
james.

This has to be added specifically as a regex, and not as a blacklist entry. It's not a domain and will cause this error if you try to add it as one.

Yeah, that's the screen giving me the error ...

Strangely, I've just installed a new Pi-Hole in a VM, and it's working perfectly adding that regex.
I'm going to wipe the Rpi and start again...
Thanks for the help.

You are definitely entering the expression as a regex, and not as a domain?

Yeah definitely, although it's giving me other errors now... if I try and delete a blacklist entry, the whole device hangs and I have to reboot...
Definitely wiping it and starting again. The Ubuntu VM I setup works fine, so that's my temporary backup. :slight_smile:

2 posts were split to a new topic: Can't add https://app-measurement.com/sdk-exp to blocking list

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.