javascript ie / firefox
code:
function d(){
var s="<body><div class=\"nav smaller\">\n<div class=\"nav smaller\"></body>";
//var reg=/<body>((?:.|\n)+)<\/body>/; //這行正確
//var reg=/<body>([\s\S]+)<\/body>/; //這行也正確
var reg=/<body>([.\n]+)<\/body>/; //這行為何錯誤
var am=s.match(reg);
alert(am[1])
}
d();
感謝