What I want to do is split the data from the string into an array.
Here is the general idea of a text format ...
xxxxx denotes any combination of alpha-numeric whitespace data.
xxxxx
1 xxxxxxxxxx
2 xxxxxxxxxx
xxxxxxxxx
xxxxxxxxx
xxxxxxxx
3 xxxxxxxxxx
4 xxxxxxxxxx
xxxxxxxxxx
5 xxxxxxxxxx
(When numbers fall into double digits, ten places fall into the empty position before the number)
Now what I want to do is to have an array of 5 elements (in this case) that stores the number and all the data that is being tracked (including new lines). It used to be unimportant, and I could use it string.split("\n"), but now I need to distinguish based on some kind of regular expression, for example /\n [0-9]{1,2}/, so I'm looking for a quick and easy way to do this (as split () does not support regular expression).
I want the array to be like
array[1] = " 1 xxxxxxxxxx"
array[2] = " 2 xxxxxxxxxxx\nxxxxxxxxxx\nxxxxxxxxxx"
array[3] = " 3 xxxxxxxxxx"
...etc