Skip to content

Commit 18b4afd

Browse files
committed
first task
1 parent 9413076 commit 18b4afd

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
A two-digit hex number is `pattern:[0-9a-f]{2}` (assuming the flag `pattern:i` is set).
1+
Un nombre hexadécimal a deux chiffres correspond `pattern:[0-9a-f]{2}` (avec le marqueur `pattern:i`).
22

3-
We need that number `NN`, and then `:NN` repeated 5 times (more numbers);
3+
Nous avons besoin de ce nombre `NN`, et ensuite `:NN` répété 5 fois (pour les autres nombres) ;
44

5-
The regexp is: `pattern:[0-9a-f]{2}(:[0-9a-f]{2}){5}`
5+
L'expression régulière est : `pattern:[0-9a-f]{2}(:[0-9a-f]{2}){5}`
66

7-
Now let's show that the match should capture all the text: start at the beginning and end at the end. That's done by wrapping the pattern in `pattern:^...$`.
7+
Montrons maintenant que la correspondance se fait bien sur l'ensemble du texte : commence au début et termine à la fin. Cela se fait en entourant le motif de `pattern:^...$`.
88

9-
Finally:
9+
Finalement :
1010

1111
```js run
1212
let regexp = /^[0-9a-f]{2}(:[0-9a-f]{2}){5}$/i;
1313

1414
alert( regexp.test('01:32:54:67:89:AB') ); // true
1515

16-
alert( regexp.test('0132546789AB') ); // false (no colons)
16+
alert( regexp.test('0132546789AB') ); // false (pas de double point)
1717

18-
alert( regexp.test('01:32:54:67:89') ); // false (5 numbers, need 6)
18+
alert( regexp.test('01:32:54:67:89') ); // false (5 nombres, au lieu de 6)
1919

20-
alert( regexp.test('01:32:54:67:89:ZZ') ) // false (ZZ in the end)
20+
alert( regexp.test('01:32:54:67:89:ZZ') ) // false (ZZ à la fin)
2121
```
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# Check MAC-address
1+
# Vérification d'adresse MAC
22

3-
[MAC-address](https://en.wikipedia.org/wiki/MAC_address) of a network interface consists of 6 two-digit hex numbers separated by a colon.
3+
L'[addresse MAC](https://fr.wikipedia.org/wiki/Adresse_MAC) d'une interface réseau est constitué de 6 paires de nombres hexadécimaux séparés par un double point.
44

5-
For instance: `subject:'01:32:54:67:89:AB'`.
5+
Par exemple : `subject:'01:32:54:67:89:AB'`.
66

7-
Write a regexp that checks whether a string is MAC-address.
7+
Écrire une regexp qui vérifie qu'une chaîne de caractères soit bien une adresse MAC.
88

9-
Usage:
9+
Utilisation:
1010
```js
1111
let regexp = /your regexp/;
1212

1313
alert( regexp.test('01:32:54:67:89:AB') ); // true
1414

15-
alert( regexp.test('0132546789AB') ); // false (no colons)
15+
alert( regexp.test('0132546789AB') ); // false (double point manquant)
1616

17-
alert( regexp.test('01:32:54:67:89') ); // false (5 numbers, must be 6)
17+
alert( regexp.test('01:32:54:67:89') ); // false (5 paires, mais 6 attendues)
1818

19-
alert( regexp.test('01:32:54:67:89:ZZ') ) // false (ZZ at the end)
19+
alert( regexp.test('01:32:54:67:89:ZZ') ) // false (ZZ à la fin)
2020
```

0 commit comments

Comments
 (0)