Created
May 29, 2024 22:06
-
-
Save moriarty99779/d140399cd260a386dc906b7290d2ceea to your computer and use it in GitHub Desktop.
Javascript - Check if a MAC address is valid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isMACAddressValid = (mac) => /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/.test(mac); | |
document.write(isValidMACAddress("AA:22:FF:04:2D")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment