I have a text like this
Right (99.99руб.) OR Left with space (руб. 99.99) OR Right with space (99.99 руб.) OR Left (руб.99.99)
I want to find and change currency symbol with my new symbol.
Here is my code for example
var str = "Right (99.99руб.)",
symbol = '&&';
console.log(str.replace(/\(\d+\.?\d+\s?(.+)\)|\(([^0-9^\s]+)\s?\d+\.\d+\)/g, symbol))
But it replaces all the text that i have find with regex ("(99.99руб.)") instead of text in captured group ("руб.").
How can i replace only matched text ?
P.S Thanks in advance P.S.S Sorry for my english