var imgs = html.match(/<img[^>]+>/g)
document.getElementById('test').innerHTML = imgs.join('')
var str = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"str = str.replace(/^[<!DOCTYPE html].*[>]$/,"<!DOCTYPE html>")
alert(str)