"test[0].array[1]".replace(/\[/g, '.').replace(/]/g, '').split('.');
var str = "test[0].array[1]"; var out = str.replace(/([^\.]*?)\[(.*?)\]/g,'"$1",$2').replace('.',','); alert(out)
var str = "test[0].array[1]"; var out = str.replace(/([^\.]*?)\[(.*?)\]/g,'"$1","$2"').replace('.',','); alert(out)
var str = "test[0].array[1]"; alert( str.match(/\w+/g) );
alert( "test[0][2].array[1][2][3]".split(/\[|\][\.\[]?/) );