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.