Regex display bug

I entered a custom regex for blacklisting of

(?<!guest.)this.local.lan$

but all that is displayed in list of blacklisted entries is

(?

The regex seems to be entered into the list properly as trying to reenter the same expression acknowledges the duplicate entry giving the expression verbatim in the informational/error message.

Expected behavior of course is that the actual expression entered is displayed in the list of blacklisted entries

What is an example of a domain you are trying to block with this regex?

My home network has two subdomains - somehost.guest.this.local.lan, and somehost.dhcp.this.local.lan

As a safeguard I've added this to the two pihole instances that are answering requests from the guest network as I want to make sure I do not leak information given that all 4 piholes reference the same 2 bind servers that also provide A, AAAA and PTR resolution for everything under this.local.lan

In essence, resolving anything under somehost.guest.this.local.lan I am not concerned with and will not match the above expression. Anything else (somehost.dhcp.this.local.lan and somehost.this.local.lan) will be matched and not resolved.

Regex validator

I don't believe POSIX ERE (the flavor used by Pi-hole) supports negative look behinds. Regex may pass the tests at regex101 and not compile properly in Pi-hole.

Is there an alternate expression that would give equivalent results?

This?

[regex101: build, debug and test regex]Regex validator

Edit - Lookahead or lookbehind doesn't seem to work. Input is accepted, but error triangle soon given at top of web interface that vanishes when expression deleted.

Turned into two blacklist expressions

^.dhcp.this.local.lan$
^[^.]
?.this.local.lan$

The fact that the original expression does not display properly in the list - is that related to the expression not being valid in POSIX::ERE or to the web interface when the expression/string is processed for display?

It's the web interface, the data is there

Add

It's the < that breaks things.

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