Maybe something like this:
var string = "matrix(0.312321, -0.949977, 0.949977, 0.312321, 0, 0)"; var array = string.replace(/^.*\((.*)\)$/g, "$1").split(/, +/);
Note that in this way the array will contain a string. If you want the real number to be simple, this is:
array = array.map(Number);
Your js engine must support map or have a pad for it (of course, you can also convert them manually).
source share