up
This commit is contained in:
parent
ab9ab64bd5
commit
97c8f22bbb
289 changed files with 195 additions and 172 deletions
|
@ -1,20 +0,0 @@
|
|||
# Check MAC-address
|
||||
|
||||
[MAC-address](https://en.wikipedia.org/wiki/MAC_address) of a network interface consists of 6 two-digit hex numbers separated by a colon.
|
||||
|
||||
For instance: `subject:'01:32:54:67:89:AB'`.
|
||||
|
||||
Write a regexp that checks whether a string is MAC-address.
|
||||
|
||||
Usage:
|
||||
```js
|
||||
let reg = /your regexp/;
|
||||
|
||||
alert( reg.test('01:32:54:67:89:AB') ); // true
|
||||
|
||||
alert( reg.test('0132546789AB') ); // false (no colons)
|
||||
|
||||
alert( reg.test('01:32:54:67:89') ); // false (5 numbers, must be 6)
|
||||
|
||||
alert( reg.test('01:32:54:67:89:ZZ') ) // false (ZZ ad the end)
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue