JS .replace with regex
<p>I have a text like this </p>

<p>Right (99.99руб.) OR 
Left with space (руб. 99.99) OR 
Right with space (99.99 руб.) OR 
Left (руб.99.99)</p>

<p>I want to find and change currency symbol with my new symbol.</p>

<p>Here is my code for example </p>

<pre><code>var str = "Right (99.99руб.)",
    symbol = '&amp;&amp;';

console.log(str.replace(/\(\d+\.?\d+\s?(.+)\)|\(([^0-9^\s]+)\s?\d+\.\d+\)/g, symbol))
</code></pre>

<p>But it replaces all the text that i have find with regex ("(99.99руб.)") instead of text in captured group ("руб.").</p>

<p>How can i replace only matched text ?</p>

<p>P.S Thanks in advance
P.S.S Sorry for my english</p>