return
}
+var p2pBlocklistLineRe = regexp.MustCompile(`(.*):([\d.]+)-([\d.]+)`)
+
// Parse a line of the PeerGuardian Text Lists (P2P) Format. Returns !ok but
// no error if a line doesn't contain a range but isn't erroneous, such as
// comment and blank lines.
if l == "" || strings.HasPrefix(l, "#") {
return
}
- sms := regexp.MustCompile(`(.*):([\d.]+)-([\d.]+)`).FindStringSubmatch(l)
+ sms := p2pBlocklistLineRe.FindStringSubmatch(l)
if sms == nil {
err = fmt.Errorf("error parsing %q", l)
return