Is there a way to split a string based on several separators while keeping some of the separators in the splitted array?
So if I have the string "This is a-weird string,right?" I would like to get
["This", "is", "a", "-", "weird", "string", ",", "right", "?"]
I have tried using string.split(/([^a-zA-Z])/g), but I don't want to keep the whitespace. This guide seems like being something I can use, but my understanding of regex is not good enough to know how to mix those two.