How would this be done in Javascript?
strCellID.Replace(Regex.Match(strCellID, @"(?<=_m)\d+(?=_l)").Value, "-");
That regular expression uses a look-behind assertion and those aren't supported in JavaScript. You could use sub-expression captures to achieve the same result, though:
// $1 references the first captured sub-expression
strCellID.replace(/(_m)\d+(?=_l)/g, "$1-");
See also:
replace() will not change the original string, it will return a new string containing the result instead. If you put a strCellID = in front of the line of code I gave you, it would solve that particular problem. If that's not your problem, you'll need to be more specific. Maybe you could provide some input and expected output samples?codenewCellID = newCellID.replace(/(_l)\d+(?=_o)/g, "$1" + msg.d); code would I be able to use the same syntax?msg object is set up correctly).msg.d is converted to a string automatically by the + concatenation operator.