Question: is that possible to create a multidimensional array, then push another array on each those multidimensional array ?? 
lets say the variable 

```
arr = ["apple", "orange",  "Avocados", "Tomato", "Tangerine"]

```

and the output I want is:

```js
[
  ["a", ["apple", "avocados"] ], 
  [ "o", ["orange"] ], 
  ["T", ["Tomato", "Tangering"]]
]
```

the example about to create first initial to new arr multidimensional before the output, we create like this, `[[ "a"],["o"],["T"]]` and output i want is on above ( the box code )

then check again if that first initial same with a first initial array, push it on those 2d arrays, that is for example, but if array length for others is not same, we should create a function, to use it again late

Answer: 
Instead of using a regex, you could split on a colon and then use a combination of [shift](https://developer.mozilla.org/nl/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) to remove and return the first item from the array and [join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join) to concatenate the remaining items using a colon:

```js
let str = "REQUEST : LOREMLOREM : LOREM2LOREM2";
$parts = str.split(':');
[a, b] = [$parts.shift().trim(), $parts.join(':').trim()];
console.log(a);
console.log(b);
```
You can simply do:

```
var parts = str.match(/([^:]*)\s*:\s*(.*)/).slice(1)

```

This will match the whole string and extract the two desired parts. The `slice` operation makes the result a plain array and removes the whole string from the results.