Fixing regular expression for removing end tags from an html string