Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
    Bookmark Topic Watch Topic
  • New Topic

It is about regex

 
Nakul P. Patel
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Pie
Posts: 49733
69
  • Mark post as helpful
  • send pies
  • Report post to moderator
Closing as a duplicate of this thread. Please read this.
 
    Bookmark Topic Watch Topic
  • New Topic