javascript/regular expressions/replace

Hello,
I'm currently trying to display some text in a textarea, and later in just regular html on different jsp pages. To do this I have to convert from \n to <br/>, and then back from <br/> to \n. To do the former one I do
text = text.replace(/\n/g, "<br />");
which works correctly, but when reversing it,
replace("<br />", \n);
The \n disappears and it does not line break.
the way replace works is it does replace(reg exp, string).
so how would this be done?

Thanks,
David
[552 byte] By [Aikon3390] at [2007-11-19 11:34:59]
# 1 Re: javascript/regular expressions/replace
Maybe you can try

replace("<br />", /\n);

or

replace("<br />", "&nl;");
olivthill at 2007-11-10 3:45:53 >