This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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.