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
Copy file name to clipboardExpand all lines: 9-regular-expressions/08-regexp-character-sets-and-ranges/article.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,9 +93,9 @@ Les propriétés Unicode `pattern:p{…}` ne sont pas implémentées dans IE. Si
93
93
Ou simplement utiliser des intervalles de caractères dans la langue qui nous intéresse, e.g. `pattern:[а-я]` pour les lettres cyrilliques.
94
94
```
95
95
96
-
## Intervalles excluant
96
+
## Intervalles d'exclusion
97
97
98
-
En plus de ces intervalles classiques, existent les intervalles "excluant" qui ressemblent à `pattern:[^…]`.
98
+
En plus des intervalles classiques, existent les intervalles d'exclusion qui ressemblent à `pattern:[^…]`.
99
99
100
100
Ils se distinguent par un premier accent circonflexe `^` et correspond à n'importe quel caractère *à l'exception des caractères qui le suivent*.
101
101
@@ -111,37 +111,37 @@ L'exemple ci-dessous cherche n'importe quel caractère n'étant pas une lettre,
111
111
alert( "alice15@gmail.com".match(/[^\d\sA-Z]/gi) ); // @ et .
112
112
```
113
113
114
-
## Escaping in[…]
114
+
## L'échappement entre[…]
115
115
116
-
Usually when we want to find exactly a special character, we need to escape it like `pattern:\.`. And if we need a backslash, then we use `pattern:\\`, and so on.
116
+
Habituellement, lorsque nous cherchons précisément un caractère spécial, nous devons l'échapper `pattern:\.`. Et si nous cherchons un backslash, nous utilisons `pattern:\\`, et ainsi de suite.
117
117
118
-
In square brackets we can use the vast majority of special characters without escaping:
118
+
À l'intérieur de crochets nous pouvons utiliser une grande majorité des caractères spéciaux sans échappement :
119
119
120
-
-Symbols `pattern:. + ( )`never need escaping.
121
-
-A hyphen`pattern:-`is not escaped in the beginning or the end (where it does not define a range).
122
-
-A caret `pattern:^`is only escaped in the beginning (where it means exclusion).
123
-
-The closing square bracket `pattern:]`is always escaped (if we need to look for that symbol).
120
+
-Les symbols `pattern:. + ( )`ne sont jamais échappés.
121
+
-Un tiret`pattern:-`n'est pas échappé en début ou fin d'ensemble (là où il ne peut pas définir d'intervalle).
0 commit comments