Reputation: 3584
I would like to know what the difference is between (.+?)
and (.*?)
Upvotes: 12
Views: 18436
Reputation: 30969
The .+?
form requires at least one character to match, while .*?
can match none at all. Both operations are non-greedy, so they will try to find the shortest possible matching string.
Upvotes: 27