Answer the question
In order to leave comments, you need to log in
What is wrong with regular expression?
var re = /<!\-\-[^\-\->]*?\-\->/g;
var str = '..<!-- Мой -- комментарий \n тест -->';
alert( str.match(re) );
Answer the question
In order to leave comments, you need to log in
Too smart.
var re = /<!--[\s\S]*?-->/g;
var str = '..<!-- Мой -- комментарий \n тест -->';
alert( str.match(re) );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question