I would like to split by the space string " " while removing it and also
split by a comma "," while keeping it.
var str = "This is a word, and another."
var regexKeepCommaDelimeter = new RegExp(/(,)/,'g')
var regexKeepCommaRemoveSpace = new RegExp(/(????)/,'g')
var splitArray = str.split(regexKeepCommaRemoveSpace)
var desiredArray = ['This', 'is', 'a', 'word', ',', 'and', 'another.' ]
var testPassed = splitArray.every((x,i)=> x == desiredArray[i])
console.log('Arrays match:', testPassed)