Can someone please explain the difference between .+ and .+?

I have the string: "extend cup end table"

  1. The pattern e.+d finds: extend cup end
  2. The pattern e.+?d finds: extend and end

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

Edit
Report