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
We need to find the beginning of the comment `match:<!--`, then everything till the end of`match:-->`.
1
+
Necesitamos encontrar el inicio del comentario `match:<!--`, después todo hasta el fin de`match:-->`.
2
2
3
-
An acceptable variant is`pattern:<!--.*?-->` -- the lazy quantifier makes the dot stop right before`match:-->`. We also need to add flag `pattern:s`for the dot to include newlines.
3
+
Una variante aceptable es`pattern:<!--.*?-->` -- el cuantificador perezoso detiene el punto justo antes de`match:-->`. También necesitamos agregar la bandera `pattern:s`al punto para incluir líneas nuevas.
4
4
5
-
Otherwise multiline comments won't be found:
5
+
De lo contrario, no se encontrarán comentarios multilínea:
6
6
7
7
```js run
8
8
let regexp =/<!--.*?-->/gs;
9
9
10
-
let str =`... <!-- My -- comment
11
-
test --> .. <!----> ..
10
+
let str =`... <!-- Mi -- comentario
11
+
prueba --> .. <!----> ..
12
12
`;
13
13
14
-
alert( str.match(regexp) ); // '<!-- My -- comment \n test -->', '<!---->'
0 commit comments