simplify mac address regex
let the computer do the counting and repetition and case
This commit is contained in:
parent
4a8c0a57f2
commit
687600c30c
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue