From b196135cafb09d5c6b13e280015367a27accc6c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Zaj=C4=85c?= Date: Thu, 2 Nov 2023 11:21:51 +0100 Subject: [PATCH 1/3] For pl registry, if 'option expiration date' is not present, 'renewal date' should be treated as the expiry date --- whois/tldDb/tld_regexpr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whois/tldDb/tld_regexpr.py b/whois/tldDb/tld_regexpr.py index c33814b..964337f 100644 --- a/whois/tldDb/tld_regexpr.py +++ b/whois/tldDb/tld_regexpr.py @@ -735,7 +735,7 @@ def xStr(what: str, times: int = 1, firstMandatory: bool = True) -> str: "registrar": R(r"\nREGISTRAR:\s*(.+)\n"), "creation_date": R(r"\ncreated:\s*(.+)\n"), "updated_date": R(r"\nlast modified:\s*(.+)\n"), - "expiration_date": R(r"\noption expiration date:\s*(.+)\n"), + "expiration_date": R(r"(?:\noption expiration date:|renewal date:(?!(?:.|\n)*\noption expiration date:))\s*(.+)\n"), "name_servers": R(r"nameservers:%s" % xStr(r"(?:\s+(\S+)[^\n]*\n)?", 4)), "status": R(r"\nStatus:\n\s*(.+)"), } From 036970495cad61404334e94e20bb1ec2bd572d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Zaj=C4=85c?= Date: Thu, 2 Nov 2023 11:24:00 +0100 Subject: [PATCH 2/3] comment --- whois/tldDb/tld_regexpr.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/whois/tldDb/tld_regexpr.py b/whois/tldDb/tld_regexpr.py index 964337f..0883708 100644 --- a/whois/tldDb/tld_regexpr.py +++ b/whois/tldDb/tld_regexpr.py @@ -735,6 +735,8 @@ def xStr(what: str, times: int = 1, firstMandatory: bool = True) -> str: "registrar": R(r"\nREGISTRAR:\s*(.+)\n"), "creation_date": R(r"\ncreated:\s*(.+)\n"), "updated_date": R(r"\nlast modified:\s*(.+)\n"), + # If no "option expiration date:" is present, use "renewal date:", but only + # if it's not not followed by "option expiration date:". "expiration_date": R(r"(?:\noption expiration date:|renewal date:(?!(?:.|\n)*\noption expiration date:))\s*(.+)\n"), "name_servers": R(r"nameservers:%s" % xStr(r"(?:\s+(\S+)[^\n]*\n)?", 4)), "status": R(r"\nStatus:\n\s*(.+)"), From e62cd3e2a054a5b6048a443680e9397df5818570 Mon Sep 17 00:00:00 2001 From: Maarten Boot <11140490+maarten-boot@users.noreply.github.com> Date: Thu, 2 Nov 2023 13:06:00 +0100 Subject: [PATCH 3/3] Update tld_regexpr.py , add test add _test: google.pl to tld 'pl' --- whois/tldDb/tld_regexpr.py | 1 + 1 file changed, 1 insertion(+) diff --git a/whois/tldDb/tld_regexpr.py b/whois/tldDb/tld_regexpr.py index 0883708..3f387b8 100644 --- a/whois/tldDb/tld_regexpr.py +++ b/whois/tldDb/tld_regexpr.py @@ -740,6 +740,7 @@ def xStr(what: str, times: int = 1, firstMandatory: bool = True) -> str: "expiration_date": R(r"(?:\noption expiration date:|renewal date:(?!(?:.|\n)*\noption expiration date:))\s*(.+)\n"), "name_servers": R(r"nameservers:%s" % xStr(r"(?:\s+(\S+)[^\n]*\n)?", 4)), "status": R(r"\nStatus:\n\s*(.+)"), + "_test": "google.pl", } ZZ["pt"] = {