So I work with discord bots, and I wanted to make a RegEx Expression that would remove any words that did not have a comma after it. Currently, this is my code:
const { content } = message;
var argsc = content.split(/[,]+/);
argsc.shift();
console.log(argsc); //returns [ 'hello', 'sky', 'hi hello there' ]
The Orriginal Message Is +template hi,hello,sky,hi hello there, and I figured out how to remove the first word. Now I want hello there to be filtered out. I want it so that the result is ['hi', 'hello', 'sky','hi']. I know its complicated, but I have tried everything and I just cant filter out hello there. Thanks!