in reply to Re^4: can I make my regexp match first pattern instead of last?
in thread can I make my regex match first pattern instead of last?
I was under the incorrect impression that if I put in that question mark, then it would shrink the match down to just the minimum chunk of data that matches the pattern
No, you are correct. It finds the minimum chunk of data that matches /.+/ and is followed by something that matches the rest of the pattern, and still allow the whole pattern to match.
Without the non-greedy modifier, it finds the maximum chunk of data that matches /.+/ and is followed by something that matches the rest of the pattern, and still allow the whole pattern to match.
|
|---|