-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathparser_it.go
More file actions
45 lines (38 loc) · 1.94 KB
/
parser_it.go
File metadata and controls
45 lines (38 loc) · 1.94 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
package whoisparser
import (
"regexp"
)
var itParser = &Parser{
errorRegex: &ParseErrorRegex{
NoSuchDomain: regexp.MustCompile(`Status: *AVAILABLE`),
RateLimit: nil,
MalformedRequest: regexp.MustCompile(`Invalid request`),
},
registrarRegex: &RegistrarRegex{
CreatedDate: regexp.MustCompile(`(?m)^Created: *(.*?)$`),
DomainDNSSEC: regexp.MustCompile(`(?sm)Registrar(?:.*DNSSEC: *(.*?))\n\n`),
DomainName: regexp.MustCompile(`Domain: *(.*)`),
DomainStatus: regexp.MustCompile(`Status: *(.*)`),
ExpirationDate: regexp.MustCompile(`(?m)^Expire Date: *(.*)`),
NameServers: regexp.MustCompile(`(?sm)Nameservers\n(.*)\n\n`),
RegistrarName: regexp.MustCompile(`(?sm)Registrar(?:.*Name: *(.*?)$.*)\n\n`),
UpdatedDate: regexp.MustCompile(`(?m)^Last Update: *(.*)`),
},
registrantRegex: &RegistrantRegex{
Address: regexp.MustCompile(`(?ms)Registrant(?:.*?Address: *(?P<street>.*?)$.*?)\n *(?P<city>.*?)\n *(?P<postalCode>.*?)\n *(?P<province>.*?)\n *(?P<country>.*?)\n.*?Creat`),
Organization: regexp.MustCompile(`(?ms)Registrant(?:.*?Organization: *(.*?)$.*)\n\n`),
},
adminRegex: &RegistrantRegex{
Address: regexp.MustCompile(`(?ms)Admin Contact(?:.*?Address: *(?P<street>.*?)$.*?)\n *(?P<city>.*?)\n *(?P<postalCode>.*?)\n *(?P<province>.*?)\n *(?P<country>.*?)\n.*?Creat`),
Organization: regexp.MustCompile(`(?ms)Admin Contact(?:.*?Organization: *(.*?)$.*)\n\n`),
Name: regexp.MustCompile(`(?ms)Admin Contact(?:.*?Name: *(.*?)$.*)\n\n`),
},
techRegex: &RegistrantRegex{
Address: regexp.MustCompile(`(?ms)Technical Contacts(?:.*?Address: *(?P<street>.*?)$.*?)\n *(?P<city>.*?)\n *(?P<postalCode>.*?)\n *(?P<province>.*?)\n *(?P<country>.*?)\n.*?Creat`),
Organization: regexp.MustCompile(`(?ms)Technical Contacts(?:.*?Organization: *(.*?)$.*)\n\n`),
Name: regexp.MustCompile(`(?ms)Technical Contacts(?:.*?Name: *(.*?)$.*)\n\n`),
},
}
func init() {
RegisterParser(".it", itParser)
}