I have a string like
String string = \"number0 foobar number1 foofoo number2 bar bar bar bar number3 foobar\";
I need a regex to give me th
(.*) part of your regex is greedy, therefore it eats everything from that point to the end of the string. Change to non-greedy variant: (.*)?
(.*)
(.*)?
http://docs.oracle.com/javase/tutorial/essential/regex/quant.html