simplify mac address regex

let the computer do the counting and repetition and case
This commit is contained in:
Igor Galić 2015-05-29 20:13:21 +02:00
parent 4a8c0a57f2
commit 687600c30c

View file

@ -15,7 +15,7 @@ Returns true if the string passed to this function is a valid mac address.
mac = arguments[0]
if /^[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}$/.match(mac) then
if /^[a-f0-9]{1,2}(:[a-f0-9]{1,2}){5}$/i.match(mac) then
return true
else
return false