-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathparser_mx.go
More file actions
55 lines (47 loc) · 2.17 KB
/
parser_mx.go
File metadata and controls
55 lines (47 loc) · 2.17 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package whoisparser
import (
"regexp"
)
var mxParser = &Parser{
errorRegex: &ParseErrorRegex{
NoSuchDomain: regexp.MustCompile(`No_Se_Encontro_El_Objeto/Object_Not_Found`),
RateLimit: nil, //failed to call rate-limit for .mx
MalformedRequest: regexp.MustCompile(`Cadena_Invalida/Invalid_String`),
},
registrarRegex: &RegistrarRegex{
DomainName: regexp.MustCompile(`Domain Name:\s*(.+)`),
RegistrarName: regexp.MustCompile(`Registrar:\s*(.+)`),
ExpirationDate: regexp.MustCompile(`Expiration Date:\s*(.+)`),
UpdatedDate: regexp.MustCompile(`Last Updated On:\s*(.+)`),
ReferralURL: regexp.MustCompile(`URL:\s*(.+)`),
NameServers: regexp.MustCompile(`DNS: *(.*)`),
DomainDNSSEC: regexp.MustCompile(`DS Record: *(.*)`),
},
adminRegex: &RegistrantRegex{
Name: regexp.MustCompile(`Administrative Contact:(?:.*\s*)Name\.*: *(.*)`),
City: regexp.MustCompile(`Administrative Contact:(?:.*\s.)+City\.*: *(.*)`),
Province: regexp.MustCompile(`Administrative Contact:(?:.*\s.)+State\.*: *(.*)`),
Country: regexp.MustCompile(`Administrative Contact:(?:.*\s.)+Country\.*: *(.*)`),
},
registrantRegex: &RegistrantRegex{
Name: regexp.MustCompile(`Registrant:(?:.*\s*)Name\.*: *(.*)`),
City: regexp.MustCompile(`Registrant:(?:.*\s.)+City\.*: *(.*)`),
Province: regexp.MustCompile(`Registrant:(?:.*\s.)+State\.*: *(.*)`),
Country: regexp.MustCompile(`Registrant:(?:.*\s.)+Country\.*: *(.*)`),
},
techRegex: &RegistrantRegex{
Name: regexp.MustCompile(`Technical Contact:(?:.*\s*)Name\.*: *(.*)`),
City: regexp.MustCompile(`Technical Contact:(?:.*\s.)+City\.*: *(.*)`),
Province: regexp.MustCompile(`Technical Contact:(?:.*\s.)+State\.*: *(.*)`),
Country: regexp.MustCompile(`Technical Contact:(?:.*\s.)+Country\.*: *(.*)`),
},
billRegex: &RegistrantRegex{
Name: regexp.MustCompile(`Billing Contact:(?:.*\s*)Name\.*: *(.*)`),
City: regexp.MustCompile(`Billing Contact:(?:.*\s.)+City\.*: *(.*)`),
Province: regexp.MustCompile(`Billing Contact:(?:.*\s.)+State\.*: *(.*)`),
Country: regexp.MustCompile(`Billing Contact:(?:.*\s.)+Country\.*: *(.*)`),
},
}
func init() {
RegisterParser(".mx", mxParser)
}