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
+
Como puedes ver, hay coincidencia de `match:8`, con`subject:-18`. Para excluirla necesitamos asegurarnos de que `regexp` no comience la búsqueda desde el medio de otro número (no coincidente).
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
+
Podemos hacerlo especificando otra precedencia "lookbehind negativo": `pattern:(?<!-)(?<!\d)\d+`. Ahora`pattern:(?<!\d)`asegura que la coicidencia no comienza después de otro dígito, justo lo que necesitamos.
19
19
20
-
We can also join them into a single lookbehind here:
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
+
En el string de reemplazo, `$&`significa la coincidencia misma, la parte del texto original que corresponde a `pattern:<body.*?>`. Es reemplazada por sí misma más`<h1>Hello</h1>`.
As you can see, there's only lookbehind part in this regexp.
25
+
Como puedes ver, solo está presente la parte "lookbehind" en esta expresión regular.
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
+
Esto funciona así:
28
+
-En cada posición en el texto.
29
+
-Chequea si está precedida por`pattern:<body.*?>`.
30
+
-Si es así, tenemos una coincidencia.
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 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.*?>`.
33
33
34
-
So it replaces the "empty line", preceeded by`pattern:<body.*?>`, with`<h1>Hello</h1>`. That's the insertion after`<body>`.
34
+
Entonces reemplaza la "linea vacía", precedida por`pattern:<body.*?>`, con`<h1>Hello</h1>`. Esto es, la inserción después de`<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. 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