I have problem with regexp for replace html code in string. I had tried online regexp tester with match, but something causes that I canť replace. ${ProductEAN} is what I want replace. Any idea what is wrong?
The string is here:
<label for="ProductEAN" id="ProductEAN" class="col-sm-3 control-label">${ProductEAN}</label>
Javascript code:
let strToReplace = 'ProductEAN';
let reg = new RegExp('/(\$\{'+strToReplace+'\})/','g')
str.replace(reg,'some text');