isValidMacAddress static method

bool isValidMacAddress(
  1. String macAddress
)

Returns true if the given macAddress conforms to the proper regex pattern.

Regex pattern ^([0-9A-Fa-f]{2}:){5,7}([0-9A-Fa-f]{2})$

Implementation

static bool isValidMacAddress(String macAddress) =>
    RegExp(r"^([0-9A-Fa-f]{2}:){5,7}([0-9A-Fa-f]{2})$").hasMatch(macAddress);