Robin Berjon @robinberjon · 19 Feb 2014 Replying to @rodneyrehm I know it can be optimised but that’s not the point. It should just be s.replace(/(?<!\r)\n/g, "\r\n") like in all decent langs.