Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Commit 48cac19

Browse files
committed
Fixed regular expression.
In python 2.7.13-2, if the 134th line of nip.py is as follows match = re.findall('^(?:.+\.)?(\d{1,3}([-.])\d{1,3}\2\d{1,3}\2\d{1,3})$', subdomain) The execution result of dig will be as follows. $ dig 1.2.3.4.example.com +short @localhost 127.0.0.1 $ As a result of correcting the 134th line as follows, match = re.findall('^(?:.+\.)?(\d{1,3}[-.]\d{1,3}[-.]\d{1,3}[-.]\d{1,3})$', subdomain) The execution result of dig is corrected as follows. $ dig 1-2-3-4.example.com +short @localhost 1.2.3.4 $
1 parent 2f7d368 commit 48cac19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/nip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def handle_self(self, name):
131131

132132
def handle_subdomains(self, qname):
133133
subdomain = qname[0:qname.find(self.domain) - 1]
134-
match = re.findall('^(?:.+\.)?(\d{1,3}([-.])\d{1,3}\2\d{1,3}\2\d{1,3})$', subdomain)
134+
match = re.findall('^(?:.+\.)?(\d{1,3}[-.]\d{1,3}[-.]\d{1,3}[-.]\d{1,3})$', subdomain)
135135

136136
if not match:
137137
if DEBUG:

0 commit comments

Comments
 (0)