Seen in the wild: replace all the newlines with a literal $ in sed:
sed -e 's/$/$/'
It's always bugged me that regex replace syntax looks similar to regex, occurs close to the search syntax, but actually has a different meaning. It's harder to read.