Fish Wang says to YSITD
text.match(/(\\\\|\\.|.)/g).map(function (in) {if (in === '\\n') return '\n'; return in;})