The difference between (. +?) And (. *?) In regular expressions

I would like to know what is the difference between (.+?) And (.*?)

+7
source share
1 answer

Form .+? requires matching at least one character, whereas .*? may not match at all. Both operations are not greedy, so they will try to find the shortest matching string.

+17
source

All Articles