From 6cb1a5cd3d3d1f6e2e8780fc2038b054641f5be7 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Fri, 21 Sep 2012 05:07:47 +0200 Subject: [PATCH] Fix nameserver heuristics to also detect sub-subdomains --- pythonwhois/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonwhois/__init__.py b/pythonwhois/__init__.py index 63f2e00..a9b5165 100644 --- a/pythonwhois/__init__.py +++ b/pythonwhois/__init__.py @@ -33,8 +33,8 @@ grammar = { 'Registrar Name:\s?(?P.+)', 'Record maintained by:\s?(?P.+)'], 'whois_server': ['Registrar Whois:\s?(?P.+)'], - 'name_servers': ['(?Pd?ns[0-9]+\.[a-z0-9-]+\.[a-z0-9]+)', - '(?P[a-z0-9-]+\.d?ns[0-9]*\.[a-z0-9-]+\.[a-z0-9]+)', + 'name_servers': ['(?Pd?ns[0-9]+\.([a-z0-9-]+\.)+[a-z0-9]+)', + '(?P[a-z0-9-]+\.d?ns[0-9]*\.([a-z0-9-]+\.)+[a-z0-9]+)', '(?P([a-z0-9-]+\.)+[a-z0-9]+)(\s+([0-9]{1,3}\.){3}[0-9]{1,3})'], 'emails': ['(?P[\w.-]+@[\w.-]+\.[\w]{2,4})'] },