I need to get all numbers from a string like this:
"156234 something 567345 another thing 45789 anything"
The result should be a collection of numbers having:
156234, 567345, 45789
I tried @"\d+", but it will only give me 156234.
EDIT: The numbers are integers, however they can also occur like this “156234 something 567345 another thing 45789 anything2345”. In this case I only need the integers i.e 156234, 567345, 45789 and not 156234, 567345, 45789,2345.
Also the integers which i dont want will always be preceed with a text for ex:anything2345.
Everything is ok with your regex, you just need to come through all the matches.