Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def isMAC48Address(inputString)
- x = 0
- if inputString.length != 17 then
- return false
- end
- while (x < inputString.length)
- if (x + 1) % 3 == 0 then
- if inputString[x] != '-' then
- return false
- end
- end
- if (x + 1) % 3 != 0 then
- if (inputString[x] >= '0' and inputString[x] <= '9') or (inputString[x] >= 'A' and inputString[x] <= 'F') then
- else
- return false
- end
- end
- x = x + 1
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment