When I attempt to replace ...('2073')... with ....('2074')... I end up with ...(('2074'))... and I am perplexed as to why.
Check out this javascript snippet:
var sGroupIdentifier = "2073";
var sSelectedGroupTR = "... onclick=\"MakeNewGroup('2073')\">New</a> ... ";
var rex = new RegExp("\('" + sGroupIdentifier + "'\)", "g")
sNewGroupIdentifier = "2074";
var sNewGroupTR = sSelectedGroupTR.replace(rex, "(\'" + sNewGroupIdentifier + "\')");
alert(sNewGroupTR)
I could remove the parenthesis in the .replace function, but my confusion remains. It seems like there is a match for ('2073'), not '2073' - all because of the ( instead of \
Does anyone have an explanation for this?