You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An empty string is the only match: it starts and immediately finishes.
1
+
Une chaîne de caractères vide est la seule correspondance : elle commence et se termine aussitôt.
2
2
3
-
The task once again demonstrates that anchors are not characters, but tests.
3
+
Cette tâche montre à nouveau que les ancres ne sont pas des caractères, mais des tests.
4
4
5
-
The string is empty `""`. The engine first matches the`pattern:^` (input start), yes it's there, and then immediately the end`pattern:$`, it's here too. So there's a match.
5
+
La chaîne de caractères est vide `""`. Le moteur regarde en premier`pattern:^` (début de l'entrée), ça correspond, et immédiatement après la fin`pattern:$`, ça correspond également. Donc il y a une correspondance.
In these particular cases we could use string methods `startsWith/endsWith` instead. Regular expressions should be used for more complex tests.
24
24
25
-
## Testing for a full match
25
+
## Test pour une correspondance complète
26
26
27
-
Both anchors together `pattern:^...$`are often used to test whether or not a string fully matches the pattern. For instance, to check if the user input is in the right format.
27
+
Les deux ancres mises ensemble `pattern:^...$`pour vérifier si une chaîne de caractères correspond entièrement à un paterne. Par exemple, pour vérifier si l'entrée de l'utilisateur est dans le bon format.
28
28
29
-
Let's check whether or not a string is a time in`12:34` format. That is: two digits, then a colon, and then another two digits.
29
+
Vérifions si une chaîne de caractères est une heure au format`12:34`. En résumé : deux nombres, puis deux points, et enfin deux autres nombres.
30
30
31
-
In regular expressions language that's`pattern:\d\d:\d\d`:
31
+
Dans le langage des expressions régulières, c'est`pattern:\d\d:\d\d`:
0 commit comments