Skip to content
This repository was archived by the owner on Feb 3, 2024. It is now read-only.

Commit d2a7db1

Browse files
committed
fix needed after strip(\r) in _2_parse.py in version 0.19
1 parent d630753 commit d2a7db1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

whois/tld_regexpr.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@
368368

369369
download = {
370370
"extend": "amsterdam",
371-
"name_servers": r"Name Server:\s*(.+)\r",
371+
"name_servers": r"Name Server:[ \t]+(\S+)", # fix needed after strip(\r) in _2_parse.py in version 0.19
372372
"status": r"Domain Status:\s*([a-zA-z]+)",
373373
}
374374

@@ -957,8 +957,13 @@
957957
"creation_date": r"Creation Date:\s?(.+)",
958958
"expiration_date": r"Expiration Date:\s?(.+)",
959959
"updated_date": r"Modified Date:\s?(.+)",
960-
"name_servers": r"Name Servers:\r\n(?:\s*(\S+)[ \t\r]*\n)(?:\s*(\S+)[ \t\r]*\n)?(?:\s*(\S+)[ \t\r]*\n)?",
961-
"status": r"Domain Status:\s*(.*)\r\n",
960+
961+
# fix needed after strip(\r) in _2_parse.py in version 0.19
962+
# "name_servers": r"Name Servers:\r\n(?:\s*(\S+)[ \t\r]*\n)(?:\s*(\S+)[ \t\r]*\n)?(?:\s*(\S+)[ \t\r]*\n)?",
963+
"name_servers": r"Name Servers:(?:\s+(\S+))(?:\s+(\S+))?(?:\s+([\.\w]+)\s+)?",
964+
# this seems ok for 2 and 3 ns and does not catch the dnssec: line
965+
966+
"status": r"Domain Status:\s*(.*)\r?\n",
962967
# "emails": r"(\S+@\S+)",
963968
"emails": r"[\w\.-]+@[\w\.-]+\.[\w]{2,4}",
964969
}
@@ -970,7 +975,7 @@
970975
"creation_date": r"Created:\s?(.+)",
971976
"expiration_date": r"Valid Until:\s?(.+)",
972977
"updated_date": r"Updated:\s?(.+)",
973-
"name_servers": r"Nameserver:\s*(.+)\r",
978+
"name_servers": r"Nameserver:\s*(\S+)", # fix needed after strip(\r) in _2_parse.py in version 0.19
974979
"registrant": r"Contact:\s?(.+)",
975980
"registrant_country": r"Country Code:\s?(.+)\nRegistrar:",
976981
}

0 commit comments

Comments
 (0)