everybody,
I'm having performance problems with my code. An input string looks like this:
'intput = valueA valueB valueC "valueD 13" valueF... valueZ'
The goal is to assign dedicated variables to each value. Currently my code looks like this:
var myArray = intput.split(/ +(?=(?:(?:[^"]*"){2})*[^"]*$)/);
outputOne = myArray[1];
outputTwo = myArray[2];
outputThree = myArray[3];
outputFour = myArray[4];
...
outputX = myArray[30];
It seems, however, that my code is not performant enough. I'd like to process about 500 input strings per second, but I'm currently only able to process about 120.
Even a .exec doesn't change that much. I have tried the following regex:
var myArraytwo =/(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\".*?\")\s(\S+)\s(\S+)\s(\S+)\s/.exec(bufferString)
Is there a faster way to assign the above string to dedicated variables?