I have a string, like this:
let str = `... <!-- My -- comment
test --> .. <!----> ..
`;
And I want to get the comment part of the HTML string.
I try to use the Regular Express do this.
let reg = /<!(.|\s)*?>/g
str.match(reg) // ["<!-- My -- comment↵ test -->", "<!---->"]
This is ok. But When I try to another Regular Express.
let reg = /<![.|\s]*>/g;
str.match(reg) // null
So what's different in two Regular Express. Why the second is fail?