en.javascript.info/9-regular-expressions/10-regexp-greedy-and-lazy/3-find-html-comments/task.md
2019-09-06 16:50:41 +03:00

13 lines
238 B
Markdown

# Find HTML comments
Find all HTML comments in the text:
```js
let regexp = /your regexp/g;
let str = `... <!-- My -- comment
test --> .. <!----> ..
`;
alert( str.match(regexp) ); // '<!-- My -- comment \n test -->', '<!---->'
```