I have a string that's set up as follows:
text, which may or may not have spaces or numbers in it [space]number1[space]number2[space]number3
So basically, it's lots of random text, followed by a space, followed by three numbers separated by spaces. A simpler version would be:
text number1 number2 number3
There's never any leading or trailing whitespace because I trim the string first.
I'd like to split the string into the text and the three numbers, but I'm not sure how to start with the regex. I know what I can't do:
1. I can't split on spaces, because the text might have spaces.
2. I can't find the first instance of a number and use substring because there might be numbers in the text.
3. I can't find the last instance of a character because the text might end with a number.
Could anyone give me some ideas for the regex? I do know how to use the regexes, but since I'm not sure how to approach this problem in the first place I'm kind of stuck on the regex.
I'd appreciate any advice.