I’m trying to block the annoying youtube ads with pihole but unfortunately it doesn’t work for me. The following is not viewed at all:
(rr[\d]{1}---[\s]{2}-[\s]{8}-[\w]{4})\.googlevideo\.com
Has anyone had similar experiences?
Examples look like this
rr1---sn-8xgn5uxa-quhl.googlevideo.com
rr1---sn-8xgn5uxa-quhl.googlevideo.com
rr3---sn-8xgn5uxa-quhz.googlevideo.com
rr6---sn-8xgn5uxa-quhl.googlevideo.com
>Solution :
Using [\s]{2} in the pattern (which can be written as \s{2} matches 2 whitespace chars, but in the example data there is sn
The single meta characters in this case do not have to be placed between square brackets.
Looking at some documentation on this page \w \s and \d are not supported.
You might use
rr[[:digit:]]---sn-[[:alnum:]]{8}-[[:alnum:]]{4}\.googlevideo\.com
The pattern matches:
rr[[:digit:]]Matchrrand a single digit---sn-Match literally[[:alnum:]]{8}Match 8 alphanumerics-[[:alnum:]]{4}Match-and 4 alphanumerics\.googlevideo\.comMatch.googlevideo.com
See a regex demo.