Expected output:
[123,ABC S,ABC.s@xyz.com],[234,Def K,def.k@xyz.com]
Simply
var input = "123|ABC S|ABC.s@xyz.com!!234|Def K|def.k@xyz.com";
var output = input.split("!!").map(function(item) {
return item.split("|");
});
console.log( JSON.stringify( output, 0, 4 ) )
Split the input
string by !!
and then split
the individual item
s from this first split
by |