I have the following snippet where I try to replace on variable values with javascripts Regexp. But I can not figure out how should look to work
var str = 'display = 12;14&test =124;562';
var str2 = 'display';
new_values = '123;185';
var new_str = str.replace(new RegExp( str2 + '/=^[0-9];[0-9]'), new_values )
console.log(new_str);