-
Notifications
You must be signed in to change notification settings - Fork 3
/
parser_th.go
40 lines (34 loc) · 1.29 KB
/
parser_th.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package whoisparser
import (
"regexp"
)
var thParser = &Parser{
errorRegex: &ParseErrorRegex{
NoSuchDomain: regexp.MustCompile(`No match found.`),
RateLimit: nil, //failed to call rate-limit for .th
MalformedRequest: nil, //MalformedRequest and NoSuchDomain same
},
registrarRegex: &RegistrarRegex{
DomainName: regexp.MustCompile(`Domain Name:\s*(.+)`),
RegistrarName: regexp.MustCompile(`Registrar:\s*(.+)`),
NameServers: regexp.MustCompile(`Name Server:\s*(.+)`),
DomainDNSSEC: regexp.MustCompile(`DNSSEC:\s*(.+)`),
DomainStatus: regexp.MustCompile(`Status:\s*(.+)`),
UpdatedDate: regexp.MustCompile(`Updated date:\s*(.+)`),
CreatedDate: regexp.MustCompile(`Created date:\s*(.+)`),
ExpirationDate: regexp.MustCompile(`Exp date:\s*(.+)`),
},
registrantRegex: &RegistrantRegex{
Organization: regexp.MustCompile(`Domain Holder Organization:\s*(.+)`),
Country: regexp.MustCompile(`Domain Holder Country:\s*(.+)`),
Street: regexp.MustCompile(`Domain Holder Street:\s*(.+)`),
},
techRegex: &RegistrantRegex{
Organization: regexp.MustCompile(`Tech Organization:\s*(.+)`),
Street: regexp.MustCompile(`Tech Street:\s*(.+)`),
Country: regexp.MustCompile(`Tech Country:\s*(.+)`),
},
}
func init() {
RegisterParser(".th", thParser)
}