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

232 B

Find HTML comments

Find all HTML comments in the text:

let reg = /your regexp/g;

let str = `... <!-- My -- comment
 test --> ..  <!----> .. 
`;

alert( str.match(reg) ); // '<!-- My -- comment \n test -->', '<!---->'