I have a string like this: matrix(10, 0, 1, 0, -198, 23)
Then I need to match the arguments from that function and put in array:
var regexp = /.../gi
var match = regexp.exe('matrix(10, 0, 1, 0, -198, 23)');
console.debug(match) // must return: [10, 0, 1, 0, -198, 23]
I'm not very familiar with regular expression, but I think will be the fastest way to do the job.
split string is not possible in this case.
Performance test for the awnsers: http://jsperf.com/regexp-match-vs-string-split
'matrix(10, 0, 1, 0, -198, 23)'.match(/-?\d+/g)