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
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
+
Nella stringa di sostituzione`$&`identifica la stessa corrispondenza, in altre parole, la parte della stringa sorgente che trova riscontro con`pattern:<body.*?>`. Essa viene sostituita da se stessa più l'aggiunta di`<h1>Hello</h1>`.
As you can see, there's only lookbehind part in this regexp.
25
+
Come potete osservare, c'è solo la parte di lookbehind in questa regexp.
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
+
Funziona in questo modo:
28
+
-Per ogni posizione nella stringa.
29
+
-Verifica se è preceduta da`pattern:<body.*?>`.
30
+
-In caso affermativo abbiamo trovato la corrispondenza.
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
+
Il tag `pattern:<body.*?>`non verrà restituito. Il risultato di questa regexp è letteralmente una stringa vuota, ma individua le posizioni precedute da`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
+
Quindi sostituisce uno "spazio vuoto" preceduto da`pattern:<body.*?>`, con`<h1>Hello</h1>`. In altre parole effettua un inserimento dopo`<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
+
P.S. I flag `pattern:s`e`pattern:i`potrebbero inoltre risultare utili: `pattern:/<body.*?>/si`. Il flag `pattern:s`fa in modo che il `pattern:.`identifichi anche un carattere di nuova riga, e con il flag `pattern:i`otteniamo che`pattern:<body>`e `match:<BODY>`costituiscano entrambi un riscontro.
0 commit comments