Say I have a string that contains numbers and words, such as this one:
string = "there are 1234 words and numbers 5678 in here $999";
How would I separate the string into an ordered list containing sublists populated with words and numbers? The ideal list would look like this:
idealList = {{there are}, {1234}, {words and numbers}, {5678}, {in here}, {$999}}
I know how to extract all words and all numbers, but I can't create a list like the previous one.
Here's an example of what I tried to extract words and its output:
StringCases[string, RegularExpression["\\w(?<!\\d)[\\w'-]*"]]
{there, are, words, and, numbers, in, here}
I can also do this with pattern-matching instead of RegEx, but it doesn't get me closer to my goal.
Is my regex simply wrong, or does this problem require a tiny bit more involved solution?