en.javascript.info/9-regular-expressions/08-regexp-greedy-and-lazy/3-find-html-comments/task.md
2019-04-02 14:01:44 +03:00

13 lines
232 B
Markdown

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