namespace CommonLibrary
{
    public static class MacAddress
    {
        private const string Macpattern = @"^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$";

        public static bool IsMacAddressValid(string macAddress)
        {
            return IsMacAddressValid(macAddress, Macpattern);
        }

        public static bool IsMacAddressValid(string macAddress, string pattern)
        {
            return !string.IsNullOrEmpty(macAddress) && System.Text.RegularExpressions.Regex.IsMatch(macAddress, pattern);
        }
    }
}
