I have a textbox that the users can copy/paste string data into. This is going to be a string of numbers. This string of numbers could be copied/pasted from a csv string, a string separated by space, or separated by newline. So ideally I'd be able to handle all 3 (or more separators in the future).
Currently I have the below code but I just get an array of empty strings when I copy/paste from all 3 scenarios:
var data = event.originalEvent.clipboardData.getData('text/plain').split(/[\n,\S+]/);
It seems to be the \S+ that causes the issue. If I just have \n, it works for both /n and commas but as soon as I add the \S+ it gives all empty strings for everything.