Improve regex
Match eather `-` or `.` but not both at the same time.
This commit is contained in:
parent
5002b0b464
commit
f0640ada29
@ -131,7 +131,7 @@ class DynamicBackend:
|
|||||||
|
|
||||||
def handle_subdomains(self, qname):
|
def handle_subdomains(self, qname):
|
||||||
subdomain = qname[0:qname.find(self.domain) - 1]
|
subdomain = qname[0:qname.find(self.domain) - 1]
|
||||||
match = re.findall('^(?:.+\.)?(\d{1,3}[-.]\d{1,3}[-.]\d{1,3}[-.]\d{1,3})$', subdomain)
|
match = re.findall('^(?:.+\.)?(\d{1,3}([-.])\d{1,3}\2\d{1,3}\2\d{1,3})$', subdomain)
|
||||||
|
|
||||||
if not match:
|
if not match:
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
|
Loading…
Reference in New Issue
Block a user