isMACAddress method

bool isMACAddress(
  1. String? mac
)

验证MAC地址

Implementation

bool isMACAddress(String? mac) {
  const pattern = r'^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$';
  return hasMatch(mac, pattern);
}