I am working on java and I wanted to extract groups of matchings from a string, but I wonder how can I match the groups of numbers from a string.
For example, the string is "qwerty123834asdf3486dq123", I want to extract 123834 as the first group of matching and 3486 as a second group, then I need to save the first group in one variable and the second one in another variable, 123 is not required. I must do it with a grouping as 1st group of matching and 2nd, because the amount of numbers in group changes, thus I cannot take just substring.
I tried ([0-9])+, but it extracted all numbers, but I want to groups of matchings. Is it possible to do sth like this, ([0-9])+{1} to extract 123834 and ([0-9])+{2} to extract 3486