This POST explains the concept of greedy quantifiers very nicely.
PS: I found the answer to your question by searching the forum. Please try and do the same before posting. The quantity, quality and variety of questions/answers discussed in this forum is simply amazing for OCPJP. Searching and reading other posts in this forum here will probably help you not only find your answer but will also give you insights and understanding on other aspects or areas relevant to the exam that you were not familiar or unclear about. I say this with respect to my own experience of spending some time here.
Of course, if you still have doubts after searching then post away