Skip to contents

Check whether strings are valid MAC addresses

Usage

is_MAC(x)

Arguments

x

A character vector.

Value

A logical vector, TRUE where the whole string is a MAC address in colon, hyphen or Cisco dotted notation.

Examples

is_MAC(c("1C:4C:7E:30:D8:13", "1C:4C:7E:30:D8", "1C:4C-7E:30:D8:13"))
#> [1]  TRUE FALSE FALSE