Trying what I thought was a simple way to extract html tags. In this example I'm expecting an array with 4 elements but I get only one... am I missing something?
var htm="<a></a><b></b>";
var patt = /<.*?>/gim;
var a = patt.exec(htm);
alert(JSON.stringify(a));
Expected:
["<a>","</a>","<b>","</b>"]
But I get:
["<a>"]