This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Nakuli Patidar wrote:I have String : "extend cup end table"
case 1:If i use patter "e.+d" it will find() match: extend cup end
case 2:If i use patter "e.+?d" it will find() match: extend end
Also, you should also mention that your find() method calls are in a loop -- and in the second case, it is not a single result. The way you worded your question, you can confuse some beginners to regular expressions.