kea-manage/lib/validators/macaddr/macaddr.go
Matthew Stobbs 4d6d785924 add stringer to generate constant strings
- doing work on validation for each possible field
2024-09-24 16:58:42 -06:00

10 lines
188 B
Go

package macaddr
import "regexp"
const rxValidMac = `^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$`
func IsValid(mac string) bool {
return regexp.MustCompile(rxValidMac).MatchString(mac)
}