Fix solution using full matching
Fix solution using full matching

file:a/wol.py -> file:b/wol.py
--- a/wol.py
+++ b/wol.py
@@ -31,12 +31,12 @@
     except:
       return False
 
-    #Get the mac numbers
-    numbers = re.findall('^([A-F0-9]{2}(([:][A-F0-9]{2}){5}|([-][A-F0-9]{2}){5})|([\s][A-F0-9]{2}){5})|([a-f0-9]{2}(([:][a-f0-9]{2}){5}|([-][a-f0-9]{2}){5}|([\s][a-f0-9]{2}){5}))$', macaddress)
-    #We must have 6 results, or the MAC is invalid
-    if(len(numbers) == 6):
-	#If the result is correct, join it into a string
-        macaddress= ''.join(numbers)
+    # Check mac address format
+    found = re.fullmatch('^([A-F0-9]{2}(([:][A-F0-9]{2}){5}|([-][A-F0-9]{2}){5})|([\s][A-F0-9]{2}){5})|([a-f0-9]{2}(([:][a-f0-9]{2}){5}|([-][a-f0-9]{2}){5}|([\s][a-f0-9]{2}){5}))$', macaddress)
+    #We must found 1 match , or the MAC is invalid
+    if found:
+	#If the match is found, remove mac separator [:-\s]
+        macaddress = macaddress.replace(macaddress[2], '')
     else:
         raise ValueError('Incorrect MAC address format')