var re=/<a[^>]*href="\??([^"]+)"[^>]*>([^<]*)/g;
//tester
var str='<a href="?id1111111">link_text</a><a href="?id222222">link_text32</a><sda>asdgsewrrwewer <a href="?id2525254">aggsgfgsd</a>';
var result=new Array;
var dummyArray = new Array;
var counter = 0;
while (counter++ < 20 && (dummyArray = re.exec(str)) != null) {
if(counter-1)result[result.length] ='----';
str = str.substring(dummyArray.lastIndex - 1);
for (i = 1; i < dummyArray.length; i++) {
x = dummyArray[i];
result[result.length] = x;
}
}
console.log(result);
alert(result.join('\n'));