var subject = "<h1> \
one two<br /> \
three<br /> \
four \
</h1>";
var content,
pattern = /<h1>([\S\s]*)<\/h1>/,
match = pattern.exec(subject);
if (match != null) {
content= match[1];
pattern = /<br\s*\/?>/g;
final = content.replace(pattern, " $& "); // $& is a reference to the matched content
alert(final);
document.write('<div class="h1block"><h1>' + final + '</h1></div>');
}