i have multiple emails in string with multiple delimiters ,;:/|\""
.
im trying to slip and add in array.
im almost there small issue is coming i know something wrong in my regex.
Node JS Code:
var x = "mmmm lll\"kkkk\jjj/iiii,hhhh:gggg+ffff-eee+dddd;cccc|bbbb:aaaa";
var separators = [' ', '\\\+', '-', ';', '"', '\\|','//', '\\|', '\\\(', '\\\)', '\\*', '/', ':', '\\\?'];
console.log(separators.join('|'));
var tokens = x.split(new RegExp(separators.join('|'), 'g'));
console.log(tokens);
here is output:
|\+|-|;|"|\||//|\||\(|\)|\*|/|:|\?
[ '[email protected]',
'[email protected]',
'[email protected]@gmail.com', '[email protected],[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]' ]