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
Como puedes ver, solo está presente la parte "lookbehind" en esta expresión regular.
30
26
31
-
<<<<<<< HEAD
32
27
Esto funciona así:
33
-
- En cada posición en el texto.
34
-
-Chequea si está precedida por `pattern:<body.*?>`.
28
+
- En cada posición en el texto:
29
+
-Verifica si está precedida por `pattern:<body.*?>`.
35
30
- Si es así, tenemos una coincidencia.
36
31
37
32
La etiqueta `pattern:<body.*?>` no será devuelta. El resultado de esta expresión regular es un string vacío, pero coincide solo en las posiciones precedidas por `pattern:<body.*?>`.
38
33
39
34
Entonces reemplaza la "linea vacía", precedida por `pattern:<body.*?>`, con `<h1>Hello</h1>`. Esto es, la inserción después de `<body>`.
40
-
=======
41
-
It works like this:
42
-
- At every position in the text.
43
-
- Check if it's preceded by `pattern:<body.*?>`.
44
-
- If it's so, then we have the match.
45
-
46
-
The tag `pattern:<body.*?>` won't be returned. The result of this regexp is literally an empty string, but it matches only at positions preceded by `pattern:<body.*?>`.
47
-
48
-
So it replaces the "empty line", preceded by `pattern:<body.*?>`, with `<h1>Hello</h1>`. That's the insertion after `<body>`.
49
-
>>>>>>> 7bb6066eb6ea3a030b875cdc75433c458f80997e
50
35
51
36
P.S. Los indicadores de Regexp tales como `pattern:s` y `pattern:i` también nos pueden ser útiles: `pattern:/<body.*?>/si`. El indicador `pattern:s` hace que que el punto `pattern:.` coincida también con el carácter de salto de línea, y el indicador `pattern:i` hace que `pattern:<body>` también acepte coincidencias `match:<BODY>` en mayúsculas y minúsculas.
0 commit comments