Regex filtering bug?

When attempting to add a regex rule via the command line, as documented at https://docs.pi-hole.net/ftldns/blockingmode/, pihole is unable to validate special characters.

image

Example:
pihole --regex domain(a|b)[escape char].com

image

Gets an error message: -bash: syntax error near unexpected token `('

image

In order to add the pihole --regex domain(a|b).com rule, it actually needs to be formatted as:
pihole --regex domain [escape char ](a [escape char ]|b[escape char ])[escape char ][additional escape char ].com

image

This is, as shown in your screenshot,

a bash issue. I think we cannot do anything against it.

You don't need any escape characters when you directly edit the /etc/pihole/regex.list file

An easier method is to use single quotes:

pihole --regex 'domain(a|b)\.com'

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