Improve newline replacement regex.