-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Describe the bug
isMACAddress(str)
might be using an incorrect RegExp for testing MAC address with dots. I might be wrong, have no experience at all using MAC addresses, was just browsing the code.
The pull request that introduced the support for MAC address with dots specifically intended to support 0102.0304.05ab
, but the RegExp used is:
const macAddressWithDots = /^([0-9a-fA-F]{4}).([0-9a-fA-F]{4}).([0-9a-fA-F]{4})$/;
https://github.com/validatorjs/validator.js/blob/master/src/lib/isMACAddress.js#L7
Examples
The dots (.) allow for any character to work as separator
0102X0304X05ab
0102 0304 05ab
0102/0304/05ab
Additional context
Validator.js version: 13.5.1