From 89b981235afe8e0480961c87e5bfaa74deb8be52 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Thu, 21 Nov 2013 07:06:36 +0100 Subject: [PATCH] Fix eNom and GoDaddy regex.... again --- pythonwhois/parse.py | 6 +- test/data/theregister.com | 147 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 150 insertions(+), 3 deletions(-) create mode 100644 test/data/theregister.com diff --git a/pythonwhois/parse.py b/pythonwhois/parse.py index a441f77..ea057ed 100644 --- a/pythonwhois/parse.py +++ b/pythonwhois/parse.py @@ -278,7 +278,7 @@ def parse_registrants(data): "Registrant ID:(?P.+)\nRegistrant Name:(?P.*)\nRegistrant Organization:(?P.*)\nRegistrant Street1:(?P.*)\nRegistrant Street2:(?P.*)\nRegistrant Street3:(?P.*)\nRegistrant City:(?P.*)\nRegistrant State/Province:(?P.*)\nRegistrant Postal Code:(?P.*)\nRegistrant Country:(?P.*)\nRegistrant Phone:(?P.*)\nRegistrant Phone Ext.:(?P.*)\nRegistrant FAX:(?P.*)\nRegistrant FAX Ext.:(?P.*)\nRegistrant Email:(?P.*)", # Public Interest Registry (.org) "Registrant ID:\s*(?P.+)\nRegistrant Name:\s*(?P.+)\nRegistrant Organization:\s*(?P.*)\nRegistrant Address1:\s*(?P.+)\nRegistrant Address2:\s*(?P.*)\nRegistrant City:\s*(?P.+)\nRegistrant State/Province:\s*(?P.+)\nRegistrant Postal Code:\s*(?P.+)\nRegistrant Country:\s*(?P.+)\nRegistrant Country Code:\s*(?P.+)\nRegistrant Phone Number:\s*(?P.+)\nRegistrant Email:\s*(?P.+)\n", # .CO Internet "Registrant Contact: (?P.+)\nRegistrant Organization: (?P.+)\nRegistrant Name: (?P.+)\nRegistrant Street: (?P.+)\nRegistrant City: (?P.+)\nRegistrant Postal Code: (?P.+)\nRegistrant State: (?P.+)\nRegistrant Country: (?P.+)\nRegistrant Phone: (?P.*)\nRegistrant Phone Ext: (?P.*)\nRegistrant Fax: (?P.*)\nRegistrant Fax Ext: (?P.*)\nRegistrant Email: (?P.*)\n", # Key-Systems GmbH - "Registrant Name: (?P.*)\nRegistrant Organization: (?P.*)\nRegistrant Street: (?P.+)\n(?:Registrant Street: (?P.+)\n)?Registrant City: (?P.+)\nRegistrant State\/Province: (?P.+)\nRegistrant Postal Code: (?P.+)\nRegistrant Country: (?P.+)\n(?:Registrant Phone: (?P.*)\n)?(?:Registrant Phone Ext: (?P.*)\n)?(?:Registrant Fax: (?P.*)\n)?(?:Registrant Fax Ext:\s*?(?P.*)\n)?(?:Registrant Email: (?P.+)\n)?", # WildWestDomains, GoDaddy, Namecheap/eNom + "Registrant Name:[ ]*(?P.*)\nRegistrant Organization:[ ]*(?P.*)\nRegistrant Street:[ ]*(?P.+)\n(?:Registrant Street:[ ]*(?P.+)\n)?Registrant City:[ ]*(?P.+)\nRegistrant State\/Province:[ ]*(?P.+)\nRegistrant Postal Code:[ ]*(?P.+)\nRegistrant Country:[ ]*(?P.+)\n(?:Registrant Phone:[ ]*(?P.*)\n)?(?:Registrant Phone Ext:[ ]*(?P.*)\n)?(?:Registrant Fax:[ ]*(?P.*)\n)?(?:Registrant Fax Ext:[ ]*(?P.*)\n)?(?:Registrant Email:[ ]*(?P.+)\n)?", # WildWestDomains, GoDaddy, Namecheap/eNom, Ascio "Registrant\n (?P.+)\n Email:(?P.+)\n (?P.+)\n(?: (?P.+)\n)? (?P.+) (?P.+)\n (?P.+)\n Tel: (?P.+)\n\n", # internet.bs "Holder of domain name:\n(?P[\S\s]+)\n(?P.+)\n(?P[A-Z0-9-]+)\s+(?P.+)\n(?P.+)\nContractual Language", # nic.ch "\n\n(?:Owner)?\s+: (?P.*)\n(?:\s+: (?P.*)\n)?\s+: (?P.*)\n\s+: (?P.*)\n\s+: (?P.*)\n\s+: (?P.*)\n", # nic.io @@ -292,7 +292,7 @@ def parse_registrants(data): "Tech ID:(?P.+)\nTech Name:(?P.*)\nTech Organization:(?P.*)\nTech Street1:(?P.*)\nTech Street2:(?P.*)\nTech Street3:(?P.*)\nTech City:(?P.*)\nTech State/Province:(?P.*)\nTech Postal Code:(?P.*)\nTech Country:(?P.*)\nTech Phone:(?P.*)\nTech Phone Ext.:(?P.*)\nTech FAX:(?P.*)\nTech FAX Ext.:(?P.*)\nTech Email:(?P.*)", # Public Interest Registry (.org) "Technical Contact ID:\s*(?P.+)\nTechnical Contact Name:\s*(?P.+)\nTechnical Contact Organization:\s*(?P.*)\nTechnical Contact Address1:\s*(?P.+)\nTechnical Contact Address2:\s*(?P.*)\nTechnical Contact City:\s*(?P.+)\nTechnical Contact State/Province:\s*(?P.+)\nTechnical Contact Postal Code:\s*(?P.+)\nTechnical Contact Country:\s*(?P.+)\nTechnical Contact Country Code:\s*(?P.+)\nTechnical Contact Phone Number:\s*(?P.+)\nTechnical Contact Email:\s*(?P.+)\n", # .CO Internet "Tech Contact: (?P.+)\nTech Organization: (?P.+)\nTech Name: (?P.+)\nTech Street: (?P.+)\nTech City: (?P.+)\nTech Postal Code: (?P.+)\nTech State: (?P.+)\nTech Country: (?P.+)\nTech Phone: (?P.*)\nTech Phone Ext: (?P.*)\nTech Fax: (?P.*)\nTech Fax Ext: (?P.*)\nTech Email: (?P.*)\n", # Key-Systems GmbH - "Tech Name: (?P.*)\nTech Organization: (?P.*)\nTech Street: (?P.+)\n(?:Tech Street: (?P.+)\n)?Tech City: (?P.+)\nTech State\/Province: (?P.+)\nTech Postal Code: (?P.+)\nTech Country: (?P.+)\n(?:Tech Phone: (?P.*)\n)?(?:Tech Phone Ext: (?P.*)\n)?(?:Tech Fax: (?P.*)\n)?(?:Tech Fax Ext:\s*?(?P.*)\n)?(?:Tech Email: (?P.+)\n)?", # WildWestDomains, GoDaddy, Namecheap/eNom + "Tech[ ]*Name:[ ]*(?P.*)\nTech[ ]*Organization:[ ]*(?P.*)\nTech[ ]*Street:[ ]*(?P.+)\n(?:Tech[ ]*Street:[ ]*(?P.+)\n)?Tech[ ]*City:[ ]*(?P.+)\nTech[ ]*State\/Province:[ ]*(?P.+)\nTech[ ]*Postal[ ]*Code:[ ]*(?P.+)\nTech[ ]*Country:[ ]*(?P.+)\n(?:Tech[ ]*Phone:[ ]*(?P.*)\n)?(?:Tech[ ]*Phone[ ]*Ext:[ ]*(?P.*)\n)?(?:Tech[ ]*Fax:[ ]*(?P.*)\n)?(?:Tech[ ]*Fax[ ]*Ext:\s*?(?P.*)\n)?(?:Tech[ ]*Email:[ ]*(?P.+)\n)?", # WildWestDomains, GoDaddy, Namecheap/eNom, Ascio "Technical Contact\n (?P.+)\n Email:(?P.+)\n (?P.+)\n(?: (?P.+)\n)? (?P.+) (?P.+)\n (?P.+)\n Tel: (?P.+)\n\n", # internet.bs "Technical contact:\n(?P[\S\s]+)\n(?P.+)\n(?P[A-Z0-9-]+)\s+(?P.+)\n(?P.+)\n\n" # nic.ch ] @@ -302,7 +302,7 @@ def parse_registrants(data): "Admin ID:(?P.+)\nAdmin Name:(?P.*)\nAdmin Organization:(?P.*)\nAdmin Street1:(?P.*)\nAdmin Street2:(?P.*)\nAdmin Street3:(?P.*)\nAdmin City:(?P.*)\nAdmin State/Province:(?P.*)\nAdmin Postal Code:(?P.*)\nAdmin Country:(?P.*)\nAdmin Phone:(?P.*)\nAdmin Phone Ext.:(?P.*)\nAdmin FAX:(?P.*)\nAdmin FAX Ext.:(?P.*)\nAdmin Email:(?P.*)", # Public Interest Registry (.org) "Administrative Contact ID:\s*(?P.+)\nAdministrative Contact Name:\s*(?P.+)\nAdministrative Contact Organization:\s*(?P.*)\nAdministrative Contact Address1:\s*(?P.+)\nAdministrative Contact Address2:\s*(?P.*)\nAdministrative Contact City:\s*(?P.+)\nAdministrative Contact State/Province:\s*(?P.+)\nAdministrative Contact Postal Code:\s*(?P.+)\nAdministrative Contact Country:\s*(?P.+)\nAdministrative Contact Country Code:\s*(?P.+)\nAdministrative Contact Phone Number:\s*(?P.+)\nAdministrative Contact Email:\s*(?P.+)\n", # .CO Internet "Admin Contact: (?P.+)\nAdmin Organization: (?P.+)\nAdmin Name: (?P.+)\nAdmin Street: (?P.+)\nAdmin City: (?P.+)\nAdmin State: (?P.+)\nAdmin Postal Code: (?P.+)\nAdmin Country: (?P.+)\nAdmin Phone: (?P.*)\nAdmin Phone Ext: (?P.*)\nAdmin Fax: (?P.*)\nAdmin Fax Ext: (?P.*)\nAdmin Email: (?P.*)\n", # Key-Systems GmbH - "Admin Name: (?P.*)\nAdmin Organization: (?P.*)\nAdmin Street: (?P.+)\n(?:Admin Street: (?P.+)\n)?Admin City: (?P.+)\nAdmin State\/Province: (?P.+)\nAdmin Postal Code: (?P.+)\nAdmin Country: (?P.+)\n(?:Admin Phone: (?P.*)\n)?(?:Admin Phone Ext: (?P.*)\n)?(?:Admin Fax: (?P.*)\n)?(?:Admin Fax Ext:\s*?(?P.*)\n)?(?:Admin Email: (?P.+)\n)?", # WildWestDomains, GoDaddy, Namecheap/eNom + "Admin[ ]*Name:[ ]*(?P.*)\nAdmin[ ]*Organization:[ ]*(?P.*)\nAdmin[ ]*Street:[ ]*(?P.+)\n(?:Admin[ ]*Street:[ ]*(?P.+)\n)?Admin[ ]*City:[ ]*(?P.+)\nAdmin[ ]*State\/Province:[ ]*(?P.+)\nAdmin[ ]*Postal[ ]*Code:[ ]*(?P.+)\nAdmin[ ]*Country:[ ]*(?P.+)\n(?:Admin[ ]*Phone:[ ]*(?P.*)\n)?(?:Admin[ ]*Phone[ ]*Ext:[ ]*(?P.*)\n)?(?:Admin[ ]*Fax:[ ]*(?P.*)\n)?(?:Admin[ ]*Fax[ ]*Ext:\s*?(?P.*)\n)?(?:Admin[ ]*Email:[ ]*(?P.+)\n)?", # WildWestDomains, GoDaddy, Namecheap/eNom, Ascio "Administrative Contact\n (?P.+)\n Email:(?P.+)\n (?P.+)\n(?: (?P.+)\n)? (?P.+) (?P.+)\n (?P.+)\n Tel: (?P.+)\n\n", # internet.bs ] diff --git a/test/data/theregister.com b/test/data/theregister.com new file mode 100644 index 0000000..0409c82 --- /dev/null +++ b/test/data/theregister.com @@ -0,0 +1,147 @@ +The data in Ascio Technologies' WHOIS database is provided +by Ascio Technologies for information purposes only. By submitting +a WHOIS query, you agree that you will use this data only for lawful +purpose. In addition, you agree not to: +(a) use the data to allow, enable, or otherwise support any marketing +activities, regardless of the medium used. Such media include but are +not limited to e-mail, telephone, facsimile, postal mail, SMS, and +wireless alerts; or +(b) use the data to enable high volume, automated, electronic processes +that sendqueries or data to the systems of any Registry Operator or +ICANN-Accredited registrar, except as reasonably necessary to register +domain names or modify existing registrations. +(c) sell or redistribute the data except insofar as it has been +incorporated into a value-added product or service that does not permit +the extraction of a substantial portion of the bulk data from the value-added +product or service for use by other parties. +Ascio Technologies reserves the right to modify these terms at any time. +Ascio Technologies cannot guarantee the accuracy of the data provided. +By accessing and using Ascio Technologies WHOIS service, you agree to these terms. + +NOTE: FAILURE TO LOCATE A RECORD IN THE WHOIS DATABASE IS NOT +INDICATIVE OF THE AVAILABILITY OF A DOMAIN NAME. + +Domain Name: theregister.com +Registry Domain ID: +Registrar WHOIS Server: whois.ascio.com +Registrar URL: http://www.ascio.com +Updated Date: 2013-07-02T00:24:06Z +Creation Date: 2012-03-15T08:07:41Z +Registrar Registration Expiration Date: 2014-06-30T00:00:00Z +Registrar: Ascio Technologies, Inc +Registrar IANA ID: 106 +Registrar Abuse Contact Email: abuse@ascio.com +Registrar Abuse Contact Phone: +44.2070159370 +Reseller: +Domain Status: ACTIVE +Registry Registrant ID: +Registrant Name: Situation Publishing +Registrant Organization: Situation Publishing Ltd +Registrant Street: 19 Saxon Road +Registrant City: Southport +Registrant State/Province: Mersyside +Registrant Postal Code: PR8 2AX +Registrant Country: GB +Registrant Phone: +Registrant Phone Ext: +Registrant Fax: +Registrant Fax Ext: +Registrant Email: +Registry Admin ID: +Admin Name: Philip Mitchell +Admin Organization: Situation Publishing Ltd +Admin Street: 19 Saxon Road +Admin City: Southport +Admin State/Province: Merseyside +Admin Postal Code: PR8 2AX +Admin Country: GB +Admin Phone: +44.7980898072 +Admin Phone Ext: +Admin Fax: +44.7980898072 +Admin Fax Ext: +Admin Email: philip.mitchell@theregister.co.uk +Registry Tech ID: +Tech Name: NetNames Hostmaster +Tech Organization: Netnames Ltd +Tech Street: 3rd Floor Prospero House +Tech Street: 241 Borough High St. +Tech City: null +Tech State/Province: London +Tech Postal Code: SE1 1GA +Tech Country: GB +Tech Phone: +44.2070159370 +Tech Phone Ext: +Tech Fax: +44.2070159375 +Tech Fax Ext: +Tech Email: corporate-services@netnames.com +Name Server: NS1.THEREGISTER.COM +Name Server: NS2.THEREGISTER.COM +Name Server: NS3.THEREGISTER.COM +Name Server: NS4.THEREGISTER.COM +Name Server: ns1.theregister.co.uk +Name Server: ns2.theregister.co.uk +Name Server: ns3.theregister.co.uk +Name Server: ns6.theregister.co.uk +DNSSEC: +URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/ +>>> Last update of WHOIS database: 2013-11-21T05:58:08 UTC <<< + +-- + +Whois Server Version 2.0 + +Domain names in the .com and .net domains can now be registered +with many different competing registrars. Go to http://www.internic.net +for detailed information. + + Domain Name: THEREGISTER.COM + Registrar: ASCIO TECHNOLOGIES, INC. + Whois Server: whois.ascio.com + Referral URL: http://www.ascio.com + Name Server: NS1.THEREGISTER.CO.UK + Name Server: NS2.THEREGISTER.CO.UK + Name Server: NS3.THEREGISTER.CO.UK + Name Server: NS4.THEREGISTER.CO.UK + Name Server: NS5.THEREGISTER.CO.UK + Name Server: NS6.THEREGISTER.CO.UK + Status: clientDeleteProhibited + Status: clientTransferProhibited + Updated Date: 01-jul-2013 + Creation Date: 01-jul-1996 + Expiration Date: 30-jun-2014 + +>>> Last update of whois database: Thu, 21 Nov 2013 05:57:38 UTC <<< + +NOTICE: The expiration date displayed in this record is the date the +registrar's sponsorship of the domain name registration in the registry is +currently set to expire. This date does not necessarily reflect the expiration +date of the domain name registrant's agreement with the sponsoring +registrar. Users may consult the sponsoring registrar's Whois database to +view the registrar's reported date of expiration for this registration. + +TERMS OF USE: You are not authorized to access or query our Whois +database through the use of electronic processes that are high-volume and +automated except as reasonably necessary to register domain names or +modify existing registrations; the Data in VeriSign Global Registry +Services' ("VeriSign") Whois database is provided by VeriSign for +information purposes only, and to assist persons in obtaining information +about or related to a domain name registration record. VeriSign does not +guarantee its accuracy. By submitting a Whois query, you agree to abide +by the following terms of use: You agree that you may use this Data only +for lawful purposes and that under no circumstances will you use this Data +to: (1) allow, enable, or otherwise support the transmission of mass +unsolicited, commercial advertising or solicitations via e-mail, telephone, +or facsimile; or (2) enable high volume, automated, electronic processes +that apply to VeriSign (or its computer systems). The compilation, +repackaging, dissemination or other use of this Data is expressly +prohibited without the prior written consent of VeriSign. You agree not to +use electronic processes that are automated and high-volume to access or +query the Whois database except as reasonably necessary to register +domain names or modify existing registrations. VeriSign reserves the right +to restrict your access to the Whois database in its sole discretion to ensure +operational stability. VeriSign may restrict or terminate your access to the +Whois database for failure to abide by these terms of use. VeriSign +reserves the right to modify these terms at any time. + +The Registry database contains ONLY .COM, .NET, .EDU domains and +Registrars.