I'm trying to split a string into two parts using regex, but apparently, the regex is greedy so in the first group it adds a little bit more.
Example of string: "This is a phrase 22ext"
Desired result:
Group 0 = "This is a phrase"
Group 1 = "22"
The "ex"t iss discarded.
I'm using the following Regex (in java):
[^0-9]*([0-9]+).*
It works for Group 1, but in Group 0, it includes "22ext" as well.
How can I avoid it?