Assuming this string
123_4,56776_17,_,99997_1,_,87969_3,_,_,_,_,_,_,_,456_9
My desired output is:
123_4,56776_17,99997_1,87969_3,456_9
My regex appears to do the trick here https://regex101.com/r/dXtrph/1 :
(?<=)\d+_\d+(?=)
But no output in JS code. Is there an issue with the underscore?
var strng = '123_4,56776_17,_,99997_1,_,87969_3,_,_,_,_,_,_,_,456_9';
var rgx = /(?<=)\d+_\d+(?=);
var outstrng = strng.match(rgx).join(',');
Write(outstrng);