What does these following two regular expression means?
.*? and .+?
Actually I understood usage these Quantifiers i.e.
'.' -> Any character
'*' -> 0 or more times
'+' -> once or more times
'?' -> 0 or 1
Indeed, I am literally confused!!! about using .*? and .+?
.Could anybody show up with proper examples for these cases.
And you'r most welcome to share good links that presents useful examples practices. Thanks in advance.
To break down we have:
. - Any character
* - Any number of times
? - That is consumed reluctantly
. - Any character
+ - At least once
? - That is consumed reluctantly
A reluctant or "non-greedy" quantifier (the '?') matches as little as possible in order to find a match. A more in-depth look at qantifiers (greedy, reluctant and possessive) can be found here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With