I have this string :
Item 1Item 2Item 3Item 4
I want to get :
["Item 1", "Item 2", "Item 3", "Item 4"]
I tried to do this :
var string = 'Item 1Item 2Item 3Item 4'
var regex = string.split(/(\d)/)
regex.splice(-1, 1)
regex[regex.length - 2] += regex[regex.length - 1];
regex.splice(-1, 1)
console.log(regex);
But it doesn't work, any idea how to get the desired result?
EDIT :
The string at max could look like this :
Item 1Item 2Item 3Item 4Item NItem N-1
But I rather got :as inBut I'd rather get:?string.split(/(?!^)(?=Item)/)