I know it is six years late now, but I've got one solution to this ;)
function literalString(regex) {
return ('' + regex).slice(1, -1);
};
O.innerHTML = literalString(/\whatever\this\is/);
You basically convert a regex to string and removes the first and last characters.