-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathparser_org.go
39 lines (33 loc) · 1.44 KB
/
parser_org.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
package whoisparser
import (
"regexp"
)
var orgParser = &Parser{
errorRegex: &ParseErrorRegex{
NoSuchDomain: regexp.MustCompile(`NOT FOUND`),
RateLimit: regexp.MustCompile(`WHOIS LIMIT EXCEEDED`),
MalformedRequest: regexp.MustCompile(`Not a valid domain search pattern`),
},
registrarRegex: &RegistrarRegex{
CreatedDate: regexp.MustCompile(`(?i)Creation Date: *(.+)`),
DomainDNSSEC: regexp.MustCompile(`DNSSEC: *(.+)`),
DomainID: regexp.MustCompile(`Registry Domain ID: *(.+)`),
DomainName: regexp.MustCompile(`Domain Name: *(.+)`),
DomainStatus: regexp.MustCompile(`(?i)Domain status: *(.+)`),
Emails: regexp.MustCompile(`(?i)Registrar Abuse Contact Email: *(` + EmailRegex + `)`),
ExpirationDate: regexp.MustCompile(`Registrar Registration Expiration Date: *(.+)`),
NameServers: regexp.MustCompile(`Name Server: *(.+)`),
RegistrarID: regexp.MustCompile(`Registrar IANA ID: *(.+)`),
RegistrarName: regexp.MustCompile(`Registrar: *(.+)`),
UpdatedDate: regexp.MustCompile(`(?i)Updated Date: *(.+)`),
WhoisServer: regexp.MustCompile(`(?i)Registrar WHOIS Server: *(.+)`),
},
registrantRegex: &RegistrantRegex{
Organization: regexp.MustCompile(`(?i)Registrant Organization: *(.+)`),
Province: regexp.MustCompile(`(?i)Registrant State/Province: *(.+)`),
Country: regexp.MustCompile(`(?i)Registrant Country: *(.+)`),
},
}
func init() {
RegisterParser(".org", orgParser)
}