mac
Validates that a field contains a valid MAC address.
Options
| Option | Type | Default | Description |
|---|---|---|---|
message | string | locale default | Custom error message |
Playground
Valid values
| Value | Notes |
|---|---|
"01:23:45:67:89:ab" | Colon-separated, lowercase |
"01-23-45-67-89-AB" | Hyphen-separated, uppercase |
Invalid values
| Value | Reason |
|---|---|
"ZZ:ZZ:ZZ:ZZ:ZZ:ZZ" | Z is not a hex digit |
"01:23:45:67:89" | Only 5 groups instead of 6 |
Notes
- Empty string (
"") always returnsvalid: true. Combine withnotEmptyto require a value.