What\'s the best way to validate that an MAC address entered by the user?
The format is HH:HH:HH:HH:HH:HH, where each H is a hexadecimal ch
HH:HH:HH:HH:HH:HH
H
#Just works Perfect #validate the MAC addr #!/usr/bin/python import re mac = "01-3e-4f-ee-23-af" result = re.match(r"([0-9a-fA-F]{2}[-:]){5}[0-9a-fA-F]{2}$",mac) if result: print ("Correct MAC") else: print ("Incorrect MAC")