fix nameserver regex.
This commit is contained in:
parent
d589cc3622
commit
1e5ba57de3
1 changed files with 1 additions and 1 deletions
|
@ -944,7 +944,7 @@ func StripComments(input []byte, commentMarker []byte) []byte {
|
|||
func GetNameserversAsCIDR(resolvConf []byte) []string {
|
||||
var parsedResolvConf = StripComments(resolvConf, []byte("#"))
|
||||
nameservers := []string{}
|
||||
re := regexp.MustCompile(`^\s*nameserver\s*(([0-9]\.){3}([0-9]))\s*$`)
|
||||
re := regexp.MustCompile(`^\s*nameserver\s*(([0-9]+\.){3}([0-9]+))\s*$`)
|
||||
for _, line := range bytes.Split(parsedResolvConf, []byte("\n")) {
|
||||
var ns = re.FindSubmatch(line)
|
||||
if len(ns) > 0 {
|
||||
|
|
Loading…
Reference in a new issue