en.javascript.info/10-regular-expressions-javascript/08-regexp-greedy-and-lazy/3-find-html-comments/task.md
Ilya Kantor 62c507c78f ok
2017-03-19 20:40:47 +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 -->', '<!---->'