isMACAddress function

bool isMACAddress(
  1. String input, {
  2. dynamic no_colons,
})

Check if string input is a MAC Adress no_colons is an optional param

Implementation

bool isMACAddress(String input, {no_colons}) {
  if (no_colons == true) {
    return _macAddressNoColons.hasMatch(input);
  }

  return _macAddress.hasMatch(input) ||
      _macAddressWithHyphen.hasMatch(input) ||
      _macAddressWithSpaces.hasMatch(input);
}