10 lines
188 B
Go
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)
|
|
}
|