This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes It is about regex Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

It is about regex

Nakul P. Patel
Greenhorn

Joined: May 31, 2011
Posts: 25
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

Can someone please let me know what is difference between ".+" and ".+?"

I know that + is one or more and ? is one or zero. But i am not able to understand how does it work.

Thanks. Nakul
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38087
    
  22
Closing as a duplicate of this thread. Please read this.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: It is about regex
 
Similar Threads
DBAccess interface
regarding facade pattern
when extend a class
url matching doubt
Indian Team is World Champion