-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathparser_jp.go
More file actions
41 lines (33 loc) · 1.18 KB
/
parser_jp.go
File metadata and controls
41 lines (33 loc) · 1.18 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
package whoisparser
import (
"regexp"
)
var jpParser = &Parser{
errorRegex: &ParseErrorRegex{
NoSuchDomain: regexp.MustCompile(`No match!`),
RateLimit: regexp.MustCompile(`Cannot process your search request`),
MalformedRequest: regexp.MustCompile(`<JPRS WHOIS HELP>`),
},
registrarRegex: &RegistrarRegex{
CreatedDate: regexp.MustCompile(`(?i)\[Created on] *(.+)`),
DomainName: regexp.MustCompile(`(?i)\[Domain Name] *(.+)`),
DomainStatus: regexp.MustCompile(`(?i)\[Status] *(.+)`),
Emails: regexp.MustCompile(`(?i)(` + EmailRegex + `)`),
ExpirationDate: regexp.MustCompile(`(?i)\[Expires on] *(.+)`),
NameServers: regexp.MustCompile(`(?i)\[Name Server] *(.+)`),
UpdatedDate: regexp.MustCompile(`(?i)\[Last Updated] *(.+)`),
},
registrantRegex: &RegistrantRegex{
Name: regexp.MustCompile(`(?i)\[Registrant] *(.+)`),
Organization: regexp.MustCompile(`(?i)\[Organization] *(.+)`),
},
adminRegex: &RegistrantRegex{
ID: regexp.MustCompile(`(?i)\[Administrative Contact] *(.+)`),
},
techRegex: &RegistrantRegex{
ID: regexp.MustCompile(`(?i)\[Technical Contact] *(.+)`),
},
}
func init() {
RegisterParser(".jp", jpParser)
}