I have this text structure:
1.6.1 Members................................................................ 12 1.6.2 Accessibility.......................................................... 13 1.6.3 Type parameters........................................................ 13 1.6.4 The T generic type aka <T>............................................. 13
I need to create JS objects:
{ num:"1.6.1", txt:"Members" }, { num:"1.6.2", txt:"Accessibility" } ...
It's not a problem.
The problem is that I want to extract values ββthrough a Regex split through a positive lookahead:
Divide with the first time when you see the next character is a letter

What I tried:
'1.6.1 Members........... 12'.split(/\s(?=(?:[\w\. ])+$)/i)
This works fine:
["1.6.1", "Members...........", "12"]
But if I have 2 words or more:
'1.6.3 Type parameters................ 13'.split(/\s(?=(?:[\w\. ])+$)/i)
Result:
["1.6.3", "Type", "parameters................", "13"] // again, I do not care 13.
Of course, I can join them, but I want the words to be together.
Question:
How can I improve regular expression NOT for word separation?
Desired Result:
["1.6.3", "Type parameters"]
or
["1.6.3", "Type parameters........"] // I will remove add-ons later
or
["1.6.3", "Type parameters........13"] // I will remove add-ons later
N.B.
I know that I can do split through "" or another simpler solution, but I am looking (for pure knowledge) for improvement for my solution that uses a positive perspective .
Full online example:
nb2:
The text may also contain a capital letter in the middle.