I need to replace all occurrences of these 2 "_1" characters in a string with "_2", but Regex does not accept putting a variable there.
var current_registration_number = 1;
html = html.replace(/\_{current_registration_number}/g, '_'+next_registration_number);
Does anyone help me to overcome this problem?