小弟想用正则先把各个tag 和属性 及属性值还有里面的内容分别提取到一个数组里 
下面的方法还不完善  有谁能改进一下 
var topStr='<a href="#">首页</a><a href="#" class="previous">上一页</a>';
var bottomStr='<a href="#" class="next">下一页</a><a href="#">末页</a>';

var a=function(str){
var b=/<(.*)([ ]+(\w+)=["'](.*)["'])*>|>(.*)</g.exec(str);
var tag=b[1],attrKey=b[3],attrValue=b[4],html=b[5];//attrKey=b[3]这里匹配的不是一个所有属性的数组 怎样才能返回一个所有匹配的数组呢??
alert(attrKey)
}
a(bottomStr)
其实上面只要返回一个分别是tag attrKey attrValue html的数组就什么都好办了