replacing string with a period isn't working
<p>I'm trying to obfuscate an email address on a web page. I have a regex that converts the @ to <em>xy</em> and the period to <em>yy</em>. That's working. I have a js that executes when the page is submitted to convert them back but that is not working. That script is:</p>

<pre><code>function undo(){
    var oldfield = document.getElementById('hchtest').value;
    var newfield = oldfield.replace("_xy_", "@");
    var nu2field = newfield.replace("_yy_", "\.");

    document.getElementById('hchtst2').value = nu2field;
}
</code></pre>

<p>The statement that is not working is var nu2field = newfield.replace(<em>yy</em>, ".");</p>

<p>I have tried every combination I can think of (e.g. without the escape character, as a regular expression, etc.) but no joy.</p>

<p>I would also like to know it if it is possible to make this elegant by eliminating the multi-step replace.</p>

<p>Any help would be appreciated.</p>
