Skip to content

Commit

Permalink
feat: add expiry RE for domain .co.th (#111)
Browse files Browse the repository at this point in the history
* Add expiry RE for domain .co.th 🍵

* Add test with thnic.co.th domain 🍵

* Change domain to google.co.th 🍵
  • Loading branch information
mrnonz committed Dec 23, 2021
1 parent be2e328 commit 3f82aca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/whois/whois.go
Expand Up @@ -48,10 +48,11 @@ var (
"2006-01-02 15:04:05 (UTC+8)", // .tw
"02/01/2006 15:04:05", // .im
"02.01.2006 15:04:05", // .rs
"01 Feb 2006", // .co.th
}

// nolint: lll
expiryRE = regexp.MustCompile(`(?i)(Registrar Registration Expiration Date|expire-date|Valid Until|Expire Date|Registry Expiry Date|paid-till|Expiration Date|Expiration Time|Expiry date|Expiry|Expires On|expires|Expires|expire|Renewal Date|Record expires on)\]?:?\s?(.*)`)
expiryRE = regexp.MustCompile(`(?i)(Registrar Registration Expiration Date|expire-date|Valid Until|Expire Date|Registry Expiry Date|paid-till|Expiration Date|Expiration Time|Expiry date|Expiry|Expires On|expires|Expires|expire|Renewal Date|Record expires on|Exp date)\]?:?\s?(.*)`)
registrarRE = regexp.MustCompile(`(?i)Registrar WHOIS Server: (.*)`)
)

Expand Down
1 change: 1 addition & 0 deletions internal/whois/whois_test.go
Expand Up @@ -36,6 +36,7 @@ func TestWhoisParsing(t *testing.T) {
{domain: "мвд.рф", err: ""},
{domain: "МВД.РФ", err: ""},
{domain: "GOOGLE.RS", err: ""},
{domain: "google.co.th", err: ""},
} {
tt := tt
t.Run(tt.domain, func(t *testing.T) {
Expand Down

0 comments on commit 3f82aca

Please sign in to comment.