-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathparser_id.go
More file actions
39 lines (34 loc) · 1.47 KB
/
parser_id.go
File metadata and controls
39 lines (34 loc) · 1.47 KB
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 idParser = &Parser{
errorRegex: &ParseErrorRegex{
NoSuchDomain: regexp.MustCompile(`DOMAIN NOT FOUND`),
RateLimit: nil, //failed to call rate-limit for .id
MalformedRequest: nil, //MalformedRequest and NoSuchDomain same
},
registrarRegex: &RegistrarRegex{
DomainID: regexp.MustCompile(`Domain ID: *(.+)`),
DomainName: regexp.MustCompile(`Domain Name: *(.+)`),
CreatedDate: regexp.MustCompile(`Created On: *(.+)`),
UpdatedDate: regexp.MustCompile(`Last Updated On: *(.+)`),
ExpirationDate: regexp.MustCompile(`Expiration Date: *(.+)`),
DomainStatus: regexp.MustCompile(`Status: *(.+)`),
NameServers: regexp.MustCompile(`Name Server: *(.+)`),
DomainDNSSEC: regexp.MustCompile(`DNSSEC: *(.+)`),
},
registrantRegex: &RegistrantRegex{
Organization: regexp.MustCompile(`Sponsoring Registrar Organization: *(.+)`),
Country: regexp.MustCompile(`Sponsoring Registrar Country: *(.+)`),
Province: regexp.MustCompile(`Sponsoring Registrar State/Province: *(.+)`),
City: regexp.MustCompile(`Sponsoring Registrar City: *(.+)`),
PostalCode: regexp.MustCompile(`Sponsoring Registrar Postal Code: *(.+)`),
Phone: regexp.MustCompile(`Sponsoring Registrar Phone: *(.+)`),
Fax: regexp.MustCompile(`Sponsoring Registrar FAX: *(.+)`),
Email: regexp.MustCompile(`Sponsoring Registrar Contact Email: *(.+)`),
},
}
func init() {
RegisterParser(".id", idParser)
}