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
As you can see, it matches `match:8`, from `subject:-18`. To exclude it, we need to ensure that the regexp starts matching a number not from the middle of another (non-matching) number.
16
+
Comme vous pouvez le voir, il correspond à `match:8`, à partir de `subject:-18`. Pour l'exclure, nous devons nous assurer que l'expression régulière commence à correspondre à un nombre qui ne se trouve pas au milieu d'un autre nombre (non correspondant).
17
17
18
-
We can do it by specifying another negative lookbehind: `pattern:(?<!-)(?<!\d)\d+`. Now`pattern:(?<!\d)`ensures that a match does not start after another digit, just what we need.
18
+
Nous pouvons le faire en spécifiant un autre lookbehind négatif : `pattern:(?<!-)(?<!\d)\d+`. Maintenant,`pattern:(?<!\d)`garantit qu'une correspondance ne commence pas après un autre chiffre, juste ce dont nous avons besoin.
19
19
20
-
We can also join them into a single lookbehind here:
20
+
Nous pouvons également les joindre en un seul lookbehind ici:
In order to insert after the `<body>` tag, we must first find it. We can use the regular expression pattern`pattern:<body.*?>`for that.
1
+
Pour insérer après la balise `<body>`, nous devons d'abord la trouver. Nous pouvons utiliser le modèle d'expression régulière`pattern:<body.*?>`pour cela.
2
2
3
-
In this task we don't need to modify the `<body>` tag. We only need to add the text after it.
3
+
Dans cette tâche, nous n'avons pas besoin de modifier la balise `<body>`. Nous n'avons qu'à ajouter le texte après.
In the replacement string `$&`means the match itself, that is, the part of the source text that corresponds to `pattern:<body.*?>`. It gets replaced by itself plus`<h1>Hello</h1>`.
14
+
Dans la chaîne de remplacement, `$&`signifie la correspondance elle-même, c'est-à-dire la partie du texte source qui correspond à `pattern:<body.*?>`. Il est remplacé par lui-même suivi de`<h1>Hello</h1>`.
As you can see, there's only lookbehind part in this regexp.
25
+
Comme vous pouvez le voir, il n'y a qu'une partie lookbehind dans cette expression régulière.
26
26
27
-
It works like this:
28
-
-At every position in the text.
29
-
-Check if it's preceeded by`pattern:<body.*?>`.
30
-
-If it's so then we have the match.
27
+
Cela fonctionne comme ceci :
28
+
-À chaque position dans le texte.
29
+
-Vérifiez s'il est précédé de`pattern:<body.*?>`.
30
+
-Si c'est le cas, nous avons le match.
31
31
32
-
The tag`pattern:<body.*?>`won't be returned. The result of this regexp is literally an empty string, but it matches only at positions preceeded by`pattern:<body.*?>`.
32
+
La balise`pattern:<body.*?>`ne sera pas renvoyée. Le résultat de cette expression régulière est littéralement une chaîne vide, mais elle ne correspond qu'aux positions précédées de`pattern:<body.*?>`.
33
33
34
-
So it replaces the "empty line", preceeded by`pattern:<body.*?>`, with`<h1>Hello</h1>`. That's the insertion after`<body>`.
34
+
Il remplace donc la "ligne vide", précédée de`pattern:<body.*?>`, par`<h1>Hello</h1>`. C'est l'insertion après`<body>`.
35
35
36
-
P.S. Regexp flags, such as`pattern:s`and`pattern:i`can also be useful: `pattern:/<body.*?>/si`. The `pattern:s`flag makes the dot`pattern:.`match a newline character, and `pattern:i`flag makes`pattern:<body>`also match `match:<BODY>`case-insensitively.
36
+
PS Les drapeaux d'expression régulière, tels que`pattern:s`et`pattern:i`peuvent également être utiles : `pattern:/<body.*?>/si`. Le drapeau `pattern:s`fait correspondre le point`pattern:.`à un caractère de retour à la ligne, et le drapeau `pattern:i`fait que`pattern:<body>`correspond également à `match:<BODY>`insensible à la casse.
0 commit comments